diff options
38 files changed, 201 insertions, 94 deletions
diff --git a/.travis.yml b/.travis.yml index 91b8b4932c..cb574a4d8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php sudo: required -dist: precise matrix: include: diff --git a/phpBB/composer.json b/phpBB/composer.json index 4f796a9dcb..d192fd57c8 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -33,7 +33,7 @@ "marc1706/fast-image-size": "^1.1", "paragonie/random_compat": "^1.4", "patchwork/utf8": "^1.1", - "s9e/text-formatter": "~0.13.0", + "s9e/text-formatter": "^1.3", "symfony/config": "^2.8", "symfony/console": "^2.8", "symfony/debug": "^2.8", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index d235568697..a80bac724e 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c843abc1344cd9df37f63c08a125cad0", + "content-hash": "6daa2f5f7a161377dee1835bd4d5b463", "packages": [ { "name": "bantu/ini-get-wrapper", @@ -661,16 +661,16 @@ }, { "name": "s9e/text-formatter", - "version": "0.13.1", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/s9e/TextFormatter.git", - "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f" + "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", - "reference": "804ed8fdfa9fd0c8d99f5a33000d4f7e5ed90c6f", + "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/640b65b0d4c1de93bc98000c003998c08b2e7256", + "reference": "640b65b0d4c1de93bc98000c003998c08b2e7256", "shasum": "" }, "require": { @@ -681,8 +681,8 @@ }, "require-dev": { "matthiasmullie/minify": "*", - "php": ">=5.4.7", - "s9e/regexp-builder": ">=1.3.0" + "php-coveralls/php-coveralls": "*", + "s9e/regexp-builder": "1.*" }, "suggest": { "ext-curl": "Improves the performance of the MediaEmbed plugin and some JavaScript minifiers", @@ -722,7 +722,7 @@ "parser", "shortcodes" ], - "time": "2017-12-10T00:55:53+00:00" + "time": "2018-12-23T20:27:39+00:00" }, { "name": "symfony/config", @@ -2478,6 +2478,7 @@ "testing", "xunit" ], + "abandoned": true, "time": "2015-03-29T14:23:04+00:00" }, { @@ -2891,9 +2892,7 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com", - "homepage": "http://fabien.potencier.org", - "role": "Lead Developer" + "email": "fabien@symfony.com" } ], "description": "Pimple is a simple Dependency Injection Container for PHP 5.3", diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt index fc089f9e02..90e9a31127 100644 --- a/phpBB/docs/CREDITS.txt +++ b/phpBB/docs/CREDITS.txt @@ -104,3 +104,6 @@ Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff MIT licenced: Symfony2 (c) 2004-2011 Fabien Potencier, https://symfony.com/ Cookie Consent (c) 2015 Silktide Ltd, https://cookieconsent.insites.com + +Emoji by: +Twemoji (c) 2018 Twitter, Inc, https://twemoji.twitter.com/ diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index de3952cafc..8b38d554a3 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1009,6 +1009,20 @@ mcp_post_report_buttons_top_before * Since: 3.2.4-RC1 * Purpose: Add content before report buttons +mcp_post_text_after +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since: 3.2.6-RC1 +* Purpose: Add content after the post text + +mcp_post_text_before +=== +* Locations: + + styles/prosilver/template/mcp_post.html +* Since: 3.2.6-RC1 +* Purpose: Add content before the post text + mcp_topic_options_after === * Locations: diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 66f0d2116c..4ee4cd4816 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -24,9 +24,9 @@ class acp_inactive var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8e05b95849..e683b1972e 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -676,7 +676,7 @@ class acp_permissions /** * Apply permissions */ - function set_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -765,7 +765,7 @@ class acp_permissions /** * Apply all permissions */ - function set_all_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id) + function set_all_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id) { global $db, $cache, $user, $auth; global $request; @@ -881,7 +881,7 @@ class acp_permissions /** * Remove permissions */ - function remove_permissions($mode, $permission_type, &$auth_admin, &$user_id, &$group_id, &$forum_id) + function remove_permissions($mode, $permission_type, $auth_admin, &$user_id, &$group_id, &$forum_id) { global $user, $db, $cache, $auth; diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index d89c200a1b..49da7d84a4 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -845,7 +845,7 @@ class acp_profile /** * Build all Language specific options */ - function build_language_options(&$cp, $field_type, $action = 'create') + function build_language_options($cp, $field_type, $action = 'create') { global $user, $config, $db, $request; @@ -942,7 +942,7 @@ class acp_profile /** * Save Profile Field */ - function save_profile_field(&$cp, $field_type, $action = 'create') + function save_profile_field($cp, $field_type, $action = 'create') { global $db, $config, $user, $phpbb_container, $phpbb_log, $request, $phpbb_dispatcher; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index b74fe535ee..2d1eaadfae 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -24,9 +24,9 @@ class acp_users var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php index 4fe7e71117..e95fa40a58 100644 --- a/phpBB/includes/functions_compatibility.php +++ b/phpBB/includes/functions_compatibility.php @@ -391,7 +391,7 @@ function request_var($var_name, $default, $multibyte = false, $cookie = false, $ * * @deprecated 3.1.0 (To be removed: 3.3.0) */ -function get_tables(&$db) +function get_tables($db) { $db_tools_factory = new \phpbb\db\tools\factory(); $db_tools = $db_tools_factory->get($db); diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php index d91993b23f..75e24618de 100644 --- a/phpBB/includes/functions_mcp.php +++ b/phpBB/includes/functions_mcp.php @@ -22,12 +22,12 @@ if (!defined('IN_PHPBB')) /** * Functions used to generate additional URL paramters */ -function phpbb_module__url($mode, &$module_row) +function phpbb_module__url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_notes_url($mode, &$module_row) +function phpbb_module_notes_url($mode, $module_row) { if ($mode == 'front') { @@ -38,7 +38,7 @@ function phpbb_module_notes_url($mode, &$module_row) return ($user_id) ? "&u=$user_id" : ''; } -function phpbb_module_warn_url($mode, &$module_row) +function phpbb_module_warn_url($mode, $module_row) { if ($mode == 'front' || $mode == 'list') { @@ -64,27 +64,27 @@ function phpbb_module_warn_url($mode, &$module_row) } } -function phpbb_module_main_url($mode, &$module_row) +function phpbb_module_main_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_logs_url($mode, &$module_row) +function phpbb_module_logs_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_ban_url($mode, &$module_row) +function phpbb_module_ban_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_queue_url($mode, &$module_row) +function phpbb_module_queue_url($mode, $module_row) { return phpbb_extra_url(); } -function phpbb_module_reports_url($mode, &$module_row) +function phpbb_module_reports_url($mode, $module_row) { return phpbb_extra_url(); } diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index 049f24b262..79f9d35ebe 100644 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -28,9 +28,9 @@ class mcp_logs var $u_action; var $p_master; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 196d2f995f..a4e3a74ba7 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -28,9 +28,9 @@ class mcp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 12b116e495..a4c2356a43 100644 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -28,9 +28,9 @@ class mcp_notes var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index ba89733bfe..eecfe9cbc8 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -28,9 +28,9 @@ class mcp_pm_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index a95c8fad44..dec583f6f4 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -28,9 +28,9 @@ class mcp_queue var $p_master; var $u_action; - public function __construct(&$p_master) + public function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } public function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index b4018184a7..4600257344 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -28,9 +28,9 @@ class mcp_reports var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index 888069ef5d..df175133fc 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -28,9 +28,9 @@ class mcp_warn var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index ec652a5e45..5214de8c7c 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -28,9 +28,9 @@ class ucp_main var $p_master; var $u_action; - function __construct(&$p_master) + function __construct($p_master) { - $this->p_master = &$p_master; + $this->p_master = $p_master; } function main($id, $mode) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b1b039add1..621a945479 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -1195,7 +1195,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $controller_helper = $phpbb_container->get('controller.helper'); // Start assigning vars for main posting page ... - $template->assign_vars(array( + $template_ary = 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']), @@ -1240,7 +1240,19 @@ function compose_pm($id, $mode, $action, $user_folders = array()) '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')), - )); + ); + + /** + * Modify the default template vars + * + * @event core.ucp_pm_compose_template + * @var array template_ary Template variables + * @since 3.2.6-RC1 + */ + $vars = array('template_ary'); + extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_template', compact($vars))); + + $template->assign_vars($template_ary); // Build custom bbcodes array display_custom_bbcodes(); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index d0dd70af01..da60ba1866 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -489,9 +489,31 @@ switch ($mode) } // Get user... - $sql = 'SELECT * - FROM ' . USERS_TABLE . ' - WHERE ' . (($username) ? "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "user_id = $user_id"); + $sql_array = array( + 'SELECT' => 'u.*', + 'FROM' => array( + USERS_TABLE => 'u' + ), + 'WHERE' => (($username) ? "u.username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'" : "u.user_id = $user_id"), + ); + + /** + * Modify user data SQL before member profile row is created + * + * @event core.memberlist_modify_viewprofile_sql + * @var int user_id The user ID + * @var string username The username + * @var array sql_array Array containing the main query + * @since 3.2.6-RC1 + */ + $vars = array( + 'user_id', + 'username', + 'sql_array', + ); + extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_viewprofile_sql', compact($vars))); + + $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query($sql); $member = $db->sql_fetchrow($result); $db->sql_freeresult($result); @@ -523,12 +545,37 @@ switch ($mode) $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); + $sql_ary = [ + 'SELECT' => 'g.group_id, g.group_name, g.group_type, ug.user_id', + + 'FROM' => [ + GROUPS_TABLE => 'g', + ], + + 'LEFT_JOIN' => [ + [ + 'FROM' => [USER_GROUP_TABLE => 'ug'], + 'ON' => 'g.group_id = ug.group_id', + ], + ], + + 'WHERE' => $db->sql_in_set('ug.user_id', $sql_uid_ary) . ' + AND ug.user_pending = 0', + ]; + + /** + * Modify the query used to get the group data + * + * @event core.modify_memberlist_viewprofile_group_sql + * @var array sql_ary Array containing the query + * @since 3.2.6-RC1 + */ + $vars = array( + 'sql_ary', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_sql', compact($vars))); + + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); // Divide data into profile data and current user data $profile_groups = $user_groups = array(); @@ -567,6 +614,20 @@ switch ($mode) unset($user_groups); asort($group_sort); + /** + * Modify group data before options is created and data is unset + * + * @event core.modify_memberlist_viewprofile_group_data + * @var array group_data Array containing the group data + * @var array group_sort Array containing the sorted group data + * @since 3.2.6-RC1 + */ + $vars = array( + 'group_data', + 'group_sort', + ); + extract($phpbb_dispatcher->trigger_event('core.modify_memberlist_viewprofile_group_data', compact($vars))); + $group_options = ''; foreach ($group_sort as $group_id => $null) { diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php index 831e5bcfdf..6d3c9bb3d2 100644 --- a/phpBB/phpbb/captcha/plugins/gd.php +++ b/phpBB/phpbb/captcha/plugins/gd.php @@ -51,7 +51,7 @@ class gd extends captcha_abstract return 'CAPTCHA_GD'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user, $template, $phpbb_log, $request; global $config; diff --git a/phpBB/phpbb/captcha/plugins/gd_wave.php b/phpBB/phpbb/captcha/plugins/gd_wave.php index bde46f8815..4ac26ed2b7 100644 --- a/phpBB/phpbb/captcha/plugins/gd_wave.php +++ b/phpBB/phpbb/captcha/plugins/gd_wave.php @@ -33,7 +33,7 @@ class gd_wave extends captcha_abstract return '\\phpbb\\captcha\\gd_wave'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/nogd.php b/phpBB/phpbb/captcha/plugins/nogd.php index 6845e5935c..da67cd2bf4 100644 --- a/phpBB/phpbb/captcha/plugins/nogd.php +++ b/phpBB/phpbb/captcha/plugins/nogd.php @@ -33,7 +33,7 @@ class nogd extends captcha_abstract return '\\phpbb\\captcha\\non_gd'; } - function acp_page($id, &$module) + function acp_page($id, $module) { global $user; diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php index 7797212ac9..70b3f72cc3 100644 --- a/phpBB/phpbb/captcha/plugins/qa.php +++ b/phpBB/phpbb/captcha/plugins/qa.php @@ -107,8 +107,7 @@ class qa $sql = 'SELECT q.question_id, q.lang_iso FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a - WHERE q.question_id = a.question_id - GROUP BY lang_iso'; + WHERE q.question_id = a.question_id'; $result = $db->sql_query($sql, 7200); while ($row = $db->sql_fetchrow($result)) @@ -638,7 +637,7 @@ class qa /** * API function - The ACP backend, this marks the end of the easy methods */ - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $request, $phpbb_log, $template, $user; @@ -776,7 +775,7 @@ class qa /** * This handles the list overview */ - function acp_question_list(&$module) + function acp_question_list($module) { global $db, $template; diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php index 152709a9ea..b7c0b5f5e2 100644 --- a/phpBB/phpbb/captcha/plugins/recaptcha.php +++ b/phpBB/phpbb/captcha/plugins/recaptcha.php @@ -66,7 +66,7 @@ class recaptcha extends captcha_abstract throw new \Exception('No generator class given.'); } - function acp_page($id, &$module) + function acp_page($id, $module) { global $config, $template, $user, $phpbb_log, $request; diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index a9bf74094d..50e15c9844 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -261,7 +261,7 @@ class upload * * @param filespec $file Instance of filespec class */ - public function common_checks(&$file) + public function common_checks($file) { // 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)) @@ -297,7 +297,7 @@ class upload * * @return bool True if extension is allowed, false if not */ - public function valid_extension(&$file) + public function valid_extension($file) { return (in_array($file->get('extension'), $this->allowed_extensions)) ? true : false; } @@ -310,7 +310,7 @@ class upload * @return bool True if dimensions are valid or no constraints set, false * if not */ - public function valid_dimensions(&$file) + public function valid_dimensions($file) { if (!$this->max_width && !$this->max_height && !$this->min_width && !$this->min_height) { @@ -350,7 +350,7 @@ class upload * * @return bool True if content is valid, false if not */ - public function valid_content(&$file) + public function valid_content($file) { return ($file->check_content($this->disallowed_content)); } diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 2ba6d185ad..202e29ce00 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -201,7 +201,8 @@ class context $pos = strpos($blocks[$i], '['); $name = ($pos !== false) ? substr($blocks[$i], 0, $pos) : $blocks[$i]; $block = &$block[$name]; - $index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? (count($block) - 1) : (min((int) substr($blocks[$i], $pos + 1, -1), count($block) - 1)); + $block_count = empty($block) ? 0 : count($block) - 1; + $index = (!$pos || strpos($blocks[$i], '[]') === $pos) ? $block_count : (min((int) substr($blocks[$i], $pos + 1, -1), $block_count)); $block = &$block[$index]; } diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index c0bbc7b0e8..6191b9a315 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -354,6 +354,14 @@ class factory implements \phpbb\textformatter\cache_interface // Load the Emoji plugin and modify its tag's template to obey viewsmilies $tag = $configurator->Emoji->getTag(); + $tag->template = '<xsl:choose> + <xsl:when test="@tseq"> + <img alt="{.}" class="emoji" draggable="false" src="//twemoji.maxcdn.com/2/svg/{@tseq}.svg"/> + </xsl:when> + <xsl:otherwise> + <img alt="{.}" class="emoji" draggable="false" src="https://cdn.jsdelivr.net/gh/s9e/emoji-assets-twemoji@11.2/dist/svgz/{@seq}.svgz"/> + </xsl:otherwise> + </xsl:choose>'; $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="emoji smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>'; /** diff --git a/phpBB/phpbb/textformatter/s9e/link_helper.php b/phpBB/phpbb/textformatter/s9e/link_helper.php index 0f44603dec..1e113b6449 100644 --- a/phpBB/phpbb/textformatter/s9e/link_helper.php +++ b/phpBB/phpbb/textformatter/s9e/link_helper.php @@ -23,14 +23,16 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Whether the tag is valid + * @return void */ public function cleanup_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { // Invalidate if the content of the tag matches the text attribute $text = substr($parser->getText(), $tag->getPos(), $tag->getLen()); - - return ($text !== $tag->getAttribute('text')); + if ($text === $tag->getAttribute('text')) + { + $tag->invalidate(); + } } /** @@ -40,7 +42,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag URL tag (start tag) * @param \s9e\TextFormatter\Parser $parser Parser - * @return bool Always true to indicate that the tag is valid + * @return void */ public function generate_link_text_tag(\s9e\TextFormatter\Parser\Tag $tag, \s9e\TextFormatter\Parser $parser) { @@ -49,7 +51,7 @@ class link_helper // the [url] BBCode when its content is used for the URL if (!$tag->getEndTag() || !$this->should_shorten($tag, $parser->getText())) { - return true; + return; } // Capture the text between the start tag and its end tag @@ -60,8 +62,6 @@ class link_helper // Create a tag that consumes the link's text $parser->addSelfClosingTag('LINK_TEXT', $start, $length)->setAttribute('text', $text); - - return true; } /** @@ -84,7 +84,7 @@ class link_helper * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag * @param string $board_url Forum's root URL (with trailing slash) - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_local_url(\s9e\TextFormatter\Parser\Tag $tag, $board_url) { @@ -93,15 +93,13 @@ class link_helper { $tag->setAttribute('text', substr($text, strlen($board_url))); } - - return true; } /** * Truncate the replacement text set in a LINK_TEXT tag * * @param \s9e\TextFormatter\Parser\Tag $tag LINK_TEXT tag - * @return bool Always true to indicate that the tag is valid + * @return void */ public function truncate_text(\s9e\TextFormatter\Parser\Tag $tag) { @@ -109,10 +107,7 @@ class link_helper if (utf8_strlen($text) > 55) { $text = utf8_substr($text, 0, 39) . ' ... ' . utf8_substr($text, -10); + $tag->setAttribute('text', $text); } - - $tag->setAttribute('text', $text); - - return true; } } diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index ca0e5872e4..7363290e11 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -343,7 +343,7 @@ class user extends \phpbb\session } // 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 ($config['board_disable'] && !defined('IN_INSTALL') && !defined('IN_LOGIN') && !defined('SKIP_CHECK_DISABLED') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { if ($this->data['is_bot']) { diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index cf9d0bd6c1..c2297a8053 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -108,10 +108,14 @@ </p> <!-- ENDIF --> + {% EVENT mcp_post_text_before %} + <div id="post_details" class="content post_details"> {POST_PREVIEW} </div> + {% EVENT mcp_post_text_after %} + <!-- IF S_HAS_ATTACHMENTS --> <dl class="attachbox"> <dt>{L_ATTACHMENTS}</dt> diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php index 8887b9daee..05a41c5095 100644 --- a/tests/text_formatter/s9e/default_formatting_test.php +++ b/tests/text_formatter/s9e/default_formatting_test.php @@ -298,7 +298,7 @@ class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case ), array( "Emoji: \xF0\x9F\x98\x80", - 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f600.png">' + 'Emoji: <img alt="' . "\xF0\x9F\x98\x80" . '" class="emoji smilies" draggable="false" src="//twemoji.maxcdn.com/2/svg/1f600.svg">' ), array( "Emoji: \xF0\x9F\x98\x80", diff --git a/tests/text_processing/tickets_data/PHPBB3-15348.html b/tests/text_processing/tickets_data/PHPBB3-15348.html index 5d44c07899..1794232d08 100644 --- a/tests/text_processing/tickets_data/PHPBB3-15348.html +++ b/tests/text_processing/tickets_data/PHPBB3-15348.html @@ -1 +1 @@ -<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//cdn.jsdelivr.net/emojione/assets/3.1/png/64/1f197.png">
\ No newline at end of file +<img class="smilies" src="phpBB/images/smilies/icon_e_surprised.gif" width="15" height="17" alt=":o" title="First half of :ok:"> <img class="smilies" src="phpBB/images/smilies/icon_lol.gif" width="15" height="17" alt="k:" title="Second half of :ok:"> <img alt=":ok:" class="emoji smilies" draggable="false" src="//twemoji.maxcdn.com/2/svg/1f197.svg">
\ No newline at end of file diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 18b6deed1f..b41b95d925 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -79,7 +79,7 @@ class phpbb_filespec_test extends phpbb_test_case $this->phpbb_root_path = $phpbb_root_path; } - private function set_reflection_property(&$class, $property_name, $value) + private function set_reflection_property($class, $property_name, $value) { $property = new ReflectionProperty($class, $property_name); $property->setAccessible(true); diff --git a/travis/setup-mariadb.sh b/travis/setup-mariadb.sh index 9bc487915d..95445dcc55 100755 --- a/travis/setup-mariadb.sh +++ b/travis/setup-mariadb.sh @@ -12,7 +12,7 @@ set -e set -x # MariaDB Series -VERSION='5.5' +VERSION='10.0' # Operating system codename, e.g. "precise" OS_CODENAME=$(lsb_release --codename --short) diff --git a/travis/setup-php-extensions.sh b/travis/setup-php-extensions.sh index d9544858b7..918f67cd47 100755 --- a/travis/setup-php-extensions.sh +++ b/travis/setup-php-extensions.sh @@ -46,13 +46,23 @@ php_ini_file=$(find_php_ini) if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.5.0-dev', '<');"` == "1" ] then echo 'Enabling APC PHP extension' - register_php_extension 'apc' "$php_ini_file" + printf "\n" | pecl install apc echo 'apc.enable_cli=1' >> "$php_ini_file" else echo 'Disabling Opcache' echo 'opcache.enable=0' >> "$php_ini_file" fi +# APCu +if [ `php -r "echo (int) (version_compare(PHP_VERSION, '7.0.0-dev', '>=') && version_compare(PHP_VERSION, '7.3.0-dev', '<'));"` == "1" ] +then + echo 'Enabling APCu PHP extension' + printf "\n" | pecl install apcu + echo 'apc.enabled=1' >> "$php_ini_file" + echo 'apc.enable_cli=1' >> "$php_ini_file" +fi + + # redis # Disabled redis for now as it causes travis to fail # git clone git://github.com/nicolasff/phpredis.git redis diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 7fb67e0454..fd87d97449 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -19,7 +19,8 @@ sudo service nginx stop DIR=$(dirname "$0") USER=$(whoami) PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB") -NGINX_CONF="/etc/nginx/sites-enabled/default" +NGINX_SITE_CONF="/etc/nginx/sites-enabled/default" +NGINX_CONF="/etc/nginx/nginx.conf" APP_SOCK=$(realpath "$DIR")/php-app.sock # php-fpm @@ -50,6 +51,7 @@ cat $DIR/../phpBB/docs/nginx.sample.conf \ | sed -e '/If running php as fastcgi/,$d' \ | sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \ | sed -e 's/#listen 80/listen 80/' \ -| sudo tee $NGINX_CONF +| sudo tee $NGINX_SITE_CONF +sudo sed -i "s/user www-data;/user $USER;/g" $NGINX_CONF sudo service nginx start |