diff --git a/phpBB/adm/style/acp_contact.html b/phpBB/adm/style/acp_contact.html index 9884e96aa3..7aa9d8d6a6 100644 --- a/phpBB/adm/style/acp_contact.html +++ b/phpBB/adm/style/acp_contact.html @@ -62,7 +62,7 @@ -
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
+
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
diff --git a/phpBB/adm/style/acp_posting_buttons.html b/phpBB/adm/style/acp_posting_buttons.html index e032b8e77b..9055bc3240 100644 --- a/phpBB/adm/style/acp_posting_buttons.html +++ b/phpBB/adm/style/acp_posting_buttons.html @@ -3,7 +3,7 @@ // Define the bbCode tags var bbcode = new Array(); - var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]', {custom_tags.BBCODE_NAME}); + var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[size=]','[/size]', {custom_tags.BBCODE_NAME}); // ]]> @@ -32,9 +32,6 @@ - - - id="view_images" checked="checked" /> {L_YES} -
-
-
-
-
diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index 40f0fc25d9..7e9cadc46c 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -40,7 +40,7 @@
-
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
+
{L_OPTIONS}{L_COLON} {BBCODE_STATUS} :: {IMG_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index cb6afb94ed..6b8913de8c 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -72,7 +72,6 @@ $f_permissions = array( 'f_bbcode' => array(1, 0), 'f_smilies' => array(1, 0), 'f_img' => array(1, 0), - 'f_flash' => array(1, 0), 'f_sigs' => array(1, 0), 'f_search' => array(1, 0), 'f_email' => array(1, 0), @@ -167,7 +166,6 @@ $u_permissions = array( 'u_pm_forward' => array(0, 1), 'u_pm_delete' => array(0, 1), 'u_pm_img' => array(0, 1), - 'u_pm_flash' => array(0, 1), ); echo "

Determining existing permissions

\n"; diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php index 5a7f065d7f..996d83eaad 100644 --- a/phpBB/develop/adjust_bbcodes.php +++ b/phpBB/develop/adjust_bbcodes.php @@ -1,7 +1,7 @@ -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -/** -* This script will check your database for potentially dangerous flash BBCode tags -*/ - -// -// Security message: -// -// This script is potentially dangerous. -// Remove or comment the next line (die(".... ) to enable this script. -// Do NOT FORGET to either remove this script or disable it after you have used it. -// -die("Please read the first lines of this script for instructions on how to enable it\n"); - -/** -*/ -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); - -if (php_sapi_name() != 'cli') -{ - header('Content-Type: text/plain'); -} - -check_table_flash_bbcodes(POSTS_TABLE, 'post_id', 'post_text', 'bbcode_uid', 'bbcode_bitfield'); -check_table_flash_bbcodes(PRIVMSGS_TABLE, 'msg_id', 'message_text', 'bbcode_uid', 'bbcode_bitfield'); -check_table_flash_bbcodes(USERS_TABLE, 'user_id', 'user_sig', 'user_sig_bbcode_uid', 'user_sig_bbcode_bitfield'); -check_table_flash_bbcodes(FORUMS_TABLE, 'forum_id', 'forum_desc', 'forum_desc_uid', 'forum_desc_bitfield'); -check_table_flash_bbcodes(FORUMS_TABLE, 'forum_id', 'forum_rules', 'forum_rules_uid', 'forum_rules_bitfield'); -check_table_flash_bbcodes(GROUPS_TABLE, 'group_id', 'group_desc', 'group_desc_uid', 'group_desc_bitfield'); - -echo "If potentially dangerous flash bbcodes were found, please reparse the posts using the Support Toolkit (http://www.phpbb.com/support/stk/) and/or file a ticket in the Incident Tracker (http://www.phpbb.com/incidents/).\n"; - -function check_table_flash_bbcodes($table_name, $id_field, $content_field, $uid_field, $bitfield_field) -{ - echo "Checking $content_field on $table_name\n"; - - $ids = get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field); - - $size = count($ids); - if ($size) - { - echo "Found $size potentially dangerous flash bbcodes.\n"; - echo "$id_field: " . implode(', ', $ids) . "\n"; - } - else - { - echo "No potentially dangerous flash bbcodes found.\n"; - } - - echo "\n"; -} - -function get_table_flash_bbcode_pkids($table_name, $id_field, $content_field, $uid_field, $bitfield_field) -{ - global $db; - - $ids = array(); - - $sql = "SELECT $id_field, $content_field, $uid_field, $bitfield_field - FROM $table_name - WHERE $content_field LIKE '%[/flash:%' - AND $bitfield_field <> ''"; - - $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $uid = $row[$uid_field]; - - // thanks support toolkit - $content = html_entity_decode_utf8($row[$content_field]); - set_var($content, $content, 'string', true); - $content = utf8_normalize_nfc($content); - - $bitfield_data = $row[$bitfield_field]; - - if (!is_valid_flash_bbcode($content, $uid) && has_flash_enabled($bitfield_data)) - { - $ids[] = (int) $row[$id_field]; - } - } - $db->sql_freeresult($result); - - return $ids; -} - -function get_flash_regex($uid) -{ - return "#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#"; -} - -// extract all valid flash bbcodes -// check if the bbcode content is a valid URL for each match -function is_valid_flash_bbcode($cleaned_content, $uid) -{ - $regex = get_flash_regex($uid); - - $url_regex = get_preg_expression('url'); - $www_url_regex = get_preg_expression('www_url'); - - if (preg_match_all($regex, $cleaned_content, $matches)) - { - foreach ($matches[3] as $flash_url) - { - if (!preg_match("#^($url_regex|$www_url_regex)$#i", $flash_url)) - { - return false; - } - } - } - - return true; -} - -// check if a bitfield includes flash -// 11 = flash bit -function has_flash_enabled($bitfield_data) -{ - $bitfield = new bitfield($bitfield_data); - return $bitfield->get(11); -} - -// taken from support toolkit -function html_entity_decode_utf8($string) -{ - static $trans_tbl; - - // replace numeric entities - $string = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($match) { - return code2utf8(hexdec($match[1])); - }, $string); - $string = preg_replace_callback('~&#([0-9]+);~', function ($match) { - return code2utf8($match[1]); - }, $string); - - // replace literal entities - if (!isset($trans_tbl)) - { - $trans_tbl = array(); - - foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key) - $trans_tbl[$key] = utf8_encode($val); - } - return strtr($string, $trans_tbl); -} - -// taken from support toolkit -// Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv) -function code2utf8($num) -{ - if ($num < 128) return chr($num); - if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); - if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); - if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); - return ''; -} diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 719aa4881a..7d4f472916 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -195,7 +195,7 @@ class acp_bbcodes $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=', 'mention'); + $hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'mention'); if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create')) { diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 1bda032db9..8061265e11 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -174,7 +174,6 @@ class acp_board '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', @@ -190,7 +189,6 @@ class acp_board '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), 'allowed_schemes_links' => array('lang' => 'ALLOWED_SCHEMES_LINKS', 'validate' => 'csv', 'type' => 'text:0:255', 'explain' => true), @@ -238,7 +236,6 @@ class acp_board '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), diff --git a/phpBB/includes/acp/acp_contact.php b/phpBB/includes/acp/acp_contact.php index 1a4d5b95a3..56a24abdca 100644 --- a/phpBB/includes/acp/acp_contact.php +++ b/phpBB/includes/acp/acp_contact.php @@ -122,13 +122,11 @@ class acp_contact '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, )); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4123452445..579b65e137 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1609,7 +1609,6 @@ class acp_users 'post_st' => $request->variable('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0), 'view_images' => $request->variable('view_images', $this->optionget($user_row, 'viewimg')), - 'view_flash' => $request->variable('view_flash', $this->optionget($user_row, 'viewflash')), 'view_smilies' => $request->variable('view_smilies', $this->optionget($user_row, 'viewsmilies')), 'view_sigs' => $request->variable('view_sigs', $this->optionget($user_row, 'viewsigs')), 'view_avatars' => $request->variable('view_avatars', $this->optionget($user_row, 'viewavatars')), @@ -1653,7 +1652,6 @@ class acp_users if (!count($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']); @@ -1815,7 +1813,6 @@ class acp_users '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'], @@ -2073,7 +2070,6 @@ class acp_users $enable_urls, $enable_smilies, $config['allow_sig_img'], - $config['allow_sig_flash'], true, $config['allow_sig_links'], 'sig' @@ -2145,7 +2141,6 @@ class acp_users 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : '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']), @@ -2153,7 +2148,6 @@ class acp_users '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) ); diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index aa4bab2283..736c680316 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -353,25 +353,6 @@ class bbcode ); break; - case BBCODE_ID_FLASH: - 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 BBCODE_ID_ATTACH: $this->bbcode_cache[$bbcode_id] = array( 'str' => array( @@ -539,7 +520,6 @@ class bbcode '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') ); diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php index 15880d4bc8..223c8a0120 100644 --- a/phpBB/includes/compatibility_globals.php +++ b/phpBB/includes/compatibility_globals.php @@ -24,7 +24,6 @@ if (!defined('IN_PHPBB')) define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2 define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2 define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2 -define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files - @deprecated 3.3 /** * Sets compatibility globals in the global scope diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index a3aa519295..046cbf063b 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -182,7 +182,6 @@ define('BBCODE_ID_U', 7); define('BBCODE_ID_CODE', 8); define('BBCODE_ID_LIST', 9); define('BBCODE_ID_EMAIL', 10); -define('BBCODE_ID_FLASH', 11); define('BBCODE_ID_ATTACH', 12); // BBCode hard limit diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 9400b53181..f61c7928f8 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -666,14 +666,13 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text * @param bool $allow_urls If urls is allowed * @param bool $allow_smilies If smilies are allowed * @param bool $allow_img_bbcode -* @param bool $allow_flash_bbcode * @param bool $allow_quote_bbcode * @param bool $allow_url_bbcode * @param string $mode Mode to parse text as, e.g. post or sig * * @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, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $mode = 'post') +function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false, $allow_img_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $mode = 'post') { global $phpbb_root_path, $phpEx, $phpbb_dispatcher; @@ -689,12 +688,12 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb * @var bool allow_urls Whether or not to parse URLs * @var bool allow_smilies Whether or not to parse Smilies * @var bool allow_img_bbcode Whether or not to parse the [img] BBCode - * @var bool allow_flash_bbcode Whether or not to parse the [flash] BBCode * @var bool allow_quote_bbcode Whether or not to parse the [quote] BBCode * @var bool allow_url_bbcode Whether or not to parse the [url] BBCode * @var string mode Mode to parse text as, e.g. post or sig * @since 3.1.0-a1 * @changed 3.2.0-a1 Added mode + * @changed 4.0.0-a1 Removed allow_flash_bbcode */ $vars = array( 'text', @@ -705,7 +704,6 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb 'allow_urls', 'allow_smilies', 'allow_img_bbcode', - 'allow_flash_bbcode', 'allow_quote_bbcode', 'allow_url_bbcode', 'mode', @@ -721,7 +719,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb } $message_parser = new parse_message($text); - $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_flash_bbcode, $allow_quote_bbcode, $allow_url_bbcode, true, $mode); + $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_quote_bbcode, $allow_url_bbcode, true, $mode); $text = $message_parser->message; $uid = $message_parser->bbcode_uid; diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 1764650adc..bc05cf7c6f 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -887,7 +887,6 @@ function set_user_options() // 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), diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index f22e3f2c5e..3b95b20910 100644 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -560,7 +560,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) $message_parser = new parse_message(); $message_parser->message = $warn_pm_body; - $message_parser->parse(true, true, true, false, false, true, true); + $message_parser->parse(true, true, true, false, true, true); $pm_data = array( 'from_user_id' => $user->data['user_id'], diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 056f2c0bfa..2cd9906e87 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -202,11 +202,6 @@ class bbcode_firstpass extends bbcode return $bbcode_class->validate_email($match[1], $match[2]); } )), - 'flash' => array('bbcode_id' => BBCODE_ID_FLASH, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) use($bbcode_class) - { - return $bbcode_class->bbcode_flash($match[1], $match[2], $match[3]); - } - )) ); // Zero the parsed items array @@ -410,60 +405,6 @@ class bbcode_firstpass extends bbcode 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] */ @@ -1100,7 +1041,6 @@ class parse_message extends bbcode_firstpass var $message_status = ''; var $allow_img_bbcode = true; - var $allow_flash_bbcode = true; var $allow_quote_bbcode = true; var $allow_url_bbcode = true; @@ -1123,7 +1063,7 @@ class parse_message extends bbcode_firstpass /** * 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') + function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post') { global $config, $user, $phpbb_dispatcher, $phpbb_container; @@ -1138,7 +1078,6 @@ class parse_message extends bbcode_firstpass } $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; @@ -1182,7 +1121,6 @@ class parse_message extends bbcode_firstpass * @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 @@ -1194,6 +1132,7 @@ class parse_message extends bbcode_firstpass * @var array warn_msg Array of the warning messages * @since 3.1.2-RC1 * @changed 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid + * @changed 4.0.0-a1 Removed $allow_flash_bbcode */ $message = $this->message; $warn_msg = $this->warn_msg; @@ -1205,7 +1144,6 @@ class parse_message extends bbcode_firstpass 'allow_magic_url', 'allow_smilies', 'allow_img_bbcode', - 'allow_flash_bbcode', 'allow_quote_bbcode', 'allow_url_bbcode', 'update_this_message', @@ -1234,7 +1172,6 @@ class parse_message extends bbcode_firstpass ($allow_magic_url) ? $parser->enable_magic_url() : $parser->disable_magic_url(); ($allow_smilies) ? $parser->enable_smilies() : $parser->disable_smilies(); ($allow_img_bbcode) ? $parser->enable_bbcode('img') : $parser->disable_bbcode('img'); - ($allow_flash_bbcode) ? $parser->enable_bbcode('flash') : $parser->disable_bbcode('flash'); ($allow_quote_bbcode) ? $parser->enable_bbcode('quote') : $parser->disable_bbcode('quote'); ($allow_url_bbcode) ? $parser->enable_bbcode('url') : $parser->disable_bbcode('url'); @@ -1343,7 +1280,7 @@ class parse_message extends bbcode_firstpass if (!preg_match('/^<[rt][ >]/', $this->message)) { // Force updating message - of course. - $this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, $this->allow_url_bbcode, true); + $this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_quote_bbcode, $this->allow_url_bbcode, true); } // There's a bug when previewing a topic with no poll, because the empty title of the poll @@ -1919,7 +1856,7 @@ class parse_message extends bbcode_firstpass foreach ($poll['poll_options'] as &$poll_option) { $this->message = $poll_option; - $poll_option = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll'); + $poll_option = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, $config['allow_post_links'], false, 'poll'); } unset($poll_option); $poll['poll_option_text'] = implode("\n", $poll['poll_options']); @@ -1936,7 +1873,7 @@ class parse_message extends bbcode_firstpass { $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'); + $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, $config['allow_post_links'], false, 'poll'); if (strlen($poll['poll_title']) > 255) { $this->warn_msg[] = $user->lang['POLL_TITLE_COMP_TOO_LONG']; diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php index bfb058ba03..cdb70ef2f1 100644 --- a/phpBB/includes/questionnaire/questionnaire.php +++ b/phpBB/includes/questionnaire/questionnaire.php @@ -279,13 +279,11 @@ class phpbb_questionnaire_phpbb_data_provider '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, @@ -294,7 +292,6 @@ class phpbb_questionnaire_phpbb_data_provider '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, diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index afd0ca9941..cf9e9f8888 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -587,10 +587,9 @@ class ucp_main $bbcode_status = $auth->acl_get('u_pm_bbcode') || $auth->acl_getf_global('f_bbcode'); $smilies_status = $auth->acl_get('u_pm_smilies') || $auth->acl_getf_global('f_smilies'); $img_status = $auth->acl_get('u_pm_img') || $auth->acl_getf_global('f_img'); - $flash_status = $auth->acl_get('u_pm_flash') || $auth->acl_getf_global('f_flash'); $message_parser->message = $draft_message; - $message_parser->parse($bbcode_status, $config['allow_post_links'], $smilies_status, $img_status, $flash_status, true, $config['allow_post_links']); + $message_parser->parse($bbcode_status, $config['allow_post_links'], $smilies_status, $img_status, true, $config['allow_post_links']); $draft_row = array( 'draft_subject' => $draft_subject, diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 8fe4c30179..928ac084d0 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -684,7 +684,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $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; /** @@ -726,7 +725,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) if (confirm_box(true)) { $message_parser->message = $message; - $message_parser->parse($bbcode_status, $url_status, $smilies_status, $img_status, $flash_status, true, $url_status); + $message_parser->parse($bbcode_status, $url_status, $smilies_status, $img_status, true, $url_status); $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => $user->data['user_id'], @@ -872,7 +871,7 @@ function compose_pm($id, $mode, $action, $user_folders = 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']); + $message_parser->parse($enable_bbcode, ($config['allow_post_links']) ? $enable_urls : false, $enable_smilies, $img_status, true, $config['allow_post_links']); // On a refresh we do not care about message parsing errors if (count($message_parser->warn_msg) && !$refresh) @@ -1327,7 +1326,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) 'MESSAGE' => $message_text, 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : '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'], @@ -1352,7 +1350,6 @@ function compose_pm($id, $mode, $action, $user_folders = array()) '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, diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 7785aeb07b..7c64e9a54c 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -230,7 +230,6 @@ class ucp_prefs 'post_st' => $request->variable('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0), 'images' => $request->variable('images', (bool) $user->optionget('viewimg')), - 'flash' => $request->variable('flash', (bool) $user->optionget('viewflash')), 'smilies' => $request->variable('smilies', (bool) $user->optionget('viewsmilies')), 'sigs' => $request->variable('sigs', (bool) $user->optionget('viewsigs')), 'avatars' => $request->variable('avatars', (bool) $user->optionget('viewavatars')), @@ -280,7 +279,6 @@ class ucp_prefs if (!count($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']); @@ -415,7 +413,6 @@ class ucp_prefs 'ERROR' => (count($error)) ? implode('
', $error) : '', 'S_IMAGES' => $data['images'], - 'S_FLASH' => $data['flash'], 'S_SMILIES' => $data['smilies'], 'S_SIGS' => $data['sigs'], 'S_AVATARS' => $data['avatars'], diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 51ab5eddac..0f8af52828 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -538,7 +538,6 @@ class ucp_profile $enable_urls, $enable_smilies, $config['allow_sig_img'], - $config['allow_sig_flash'], true, $config['allow_sig_links'], 'sig' @@ -612,7 +611,6 @@ class ucp_profile 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : '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'], @@ -621,7 +619,6 @@ class ucp_profile '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) ); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 659ec5a24b..ee60fbf96d 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -1264,7 +1264,7 @@ function phpbb_prepare_message($message) $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') + // parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_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 (count($message_parser->warn_msg)) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 0672c81876..a429d720aa 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -28,13 +28,11 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors', INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_password_reset', '1'); 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'); @@ -45,7 +43,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allowed_schemes_li 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'); @@ -377,7 +374,6 @@ 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); @@ -489,7 +485,6 @@ 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); @@ -589,17 +584,17 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 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'); +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_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'); +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_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_mention', '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, 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_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_) @@ -618,7 +613,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%'; # Standard Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_flash', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_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_'; @@ -627,20 +622,20 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_list_topics', '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_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_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_list_topics', '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_announce_global', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_bump', 'f_delete', 'f_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_announce_global', 'f_flash', 'f_ignoreflood', 'f_sticky', 'f_user_lock'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_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_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_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'); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 8d85f898a0..226fdca18e 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -92,7 +92,6 @@ $lang = array_merge($lang, array( '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.', @@ -130,8 +129,6 @@ $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', @@ -162,8 +159,6 @@ $lang = array_merge($lang, array( 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', 'ALLOWED_SCHEMES_LINKS' => 'Allowed schemes in links', 'ALLOWED_SCHEMES_LINKS_EXPLAIN' => 'Users can only post schemeless URLs or one of the comma-separated list of allowed schemes.', - '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.', @@ -182,10 +177,6 @@ $lang = array_merge($lang, array( '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 flash height per post', - 'MAX_POST_IMG_HEIGHT_EXPLAIN' => 'Maximum height of a flash file in postings. Set to 0 for unlimited size.', - 'MAX_POST_IMG_WIDTH' => 'Maximum flash width per post', - 'MAX_POST_IMG_WIDTH_EXPLAIN' => 'Maximum width of a 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.', 'MENTIONS' => 'Mentions', @@ -211,9 +202,9 @@ $lang = array_merge($lang, array( '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_HEIGHT_EXPLAIN' => 'Maximum height of an image 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_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image 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', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 475ac5aadd..01523487b4 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -96,7 +96,6 @@ $lang = array_merge($lang, array( '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', @@ -136,7 +135,6 @@ $lang = array_merge($lang, array( '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', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 6024907c9e..fd629f4aef 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -51,7 +51,6 @@ $lang = array_merge($lang, array( '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', @@ -122,8 +121,6 @@ $lang = array_merge($lang, array( 'EMPTY_FILEUPLOAD' => 'The uploaded file is empty.', 'EMPTY_MESSAGE' => 'You must enter a message when posting.', - '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', @@ -152,14 +149,6 @@ $lang = array_merge($lang, array( 'MAX_ATTACHMENT_FILESIZE' => 'Maximum filesize per attachment: %s.', '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.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index f42992ca0b..60c33a9c20 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -586,7 +586,6 @@ $lang = array_merge($lang, array( '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', diff --git a/phpBB/phpbb/db/migration/data/v400/remove_flash.php b/phpBB/phpbb/db/migration/data/v400/remove_flash.php new file mode 100644 index 0000000000..6655b1cdf6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v400/remove_flash.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\db\migration\data\v400; + +use phpbb\db\migration\migration; + +class remove_flash extends migration +{ + public function effectively_installed() + { + return !$this->config->offsetExists('allow_post_flash'); + } + + static public function depends_on() + { + return [ + '\phpbb\db\migration\data\v400\dev', + ]; + } + + public function update_data() + { + return [ + ['config.remove', ['auth_flash_pm']], + ['config.remove', ['allow_post_flash']], + ['config.remove', ['allow_sig_flash']], + + ['permission.remove', ['f_flash', false]], + ['permission.remove', ['u_pm_flash']], + ]; + } +} diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php index 857ae2a1ec..79102f96a8 100644 --- a/phpBB/phpbb/permissions.php +++ b/phpBB/phpbb/permissions.php @@ -251,7 +251,6 @@ class permissions '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'), @@ -289,7 +288,6 @@ class permissions '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'), diff --git a/phpBB/phpbb/textformatter/data_access.php b/phpBB/phpbb/textformatter/data_access.php index 27ce778904..33e6f48d4b 100644 --- a/phpBB/phpbb/textformatter/data_access.php +++ b/phpBB/phpbb/textformatter/data_access.php @@ -136,7 +136,6 @@ class data_access 'list' => 9, '*' => 9, 'email' => 10, - 'flash' => 11, 'attachment' => 12, ); diff --git a/phpBB/phpbb/textformatter/renderer_interface.php b/phpBB/phpbb/textformatter/renderer_interface.php index 106dbdc25f..06ba02065b 100644 --- a/phpBB/phpbb/textformatter/renderer_interface.php +++ b/phpBB/phpbb/textformatter/renderer_interface.php @@ -37,13 +37,6 @@ interface renderer_interface */ public function get_viewcensors(); - /** - * Return the value of the "viewflash" option - * - * @return bool Option's value - */ - public function get_viewflash(); - /** * Return the value of the "viewimg" option * @@ -66,14 +59,6 @@ interface renderer_interface */ public function set_viewcensors($value); - /** - * Set the "viewflash" option - * - * @param bool $value Option's value - * @return null - */ - public function set_viewflash($value); - /** * Set the "viewimg" option * diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php index 6ccd15ab96..01cc545a72 100644 --- a/phpBB/phpbb/textformatter/s9e/factory.php +++ b/phpBB/phpbb/textformatter/s9e/factory.php @@ -57,7 +57,6 @@ class factory implements \phpbb\textformatter\cache_interface */ protected $custom_tokens = array( 'email' => array('{DESCRIPTION}' => '{TEXT}'), - 'flash' => array('{WIDTH}' => '{NUMBER1}', '{HEIGHT}' => '{NUMBER2}'), 'img' => array('{URL}' => '{IMAGEURL}'), 'list' => array('{LIST_TYPE}' => '{HASHMAP}'), 'quote' => array('{USERNAME}' => '{TEXT1}'), @@ -79,7 +78,6 @@ class factory implements \phpbb\textformatter\cache_interface 'code' => '[CODE lang={IDENTIFIER;optional}]{TEXT}[/CODE]', 'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]', 'email' => '[EMAIL={EMAIL;useContent} subject={TEXT1;optional;postFilter=rawurlencode} body={TEXT2;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]', - 'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]', 'i' => '[I]{TEXT}[/I]', 'img' => '[IMG src={IMAGEURL;useContent}]', 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext} #createChild=LI]{TEXT}[/LIST]', @@ -268,18 +266,6 @@ class factory implements \phpbb\textformatter\cache_interface $filter = new RegexpFilter('!^([\p{L}\p{N}\-+,_. ]+)$!Du'); $configurator->attributeFilters->add('#inttext', $filter); - // Create custom filters for Flash restrictions, which use the same values as the image - // restrictions but have their own error message - $configurator->attributeFilters - ->add('#flashheight', __NAMESPACE__ . '\\parser::filter_flash_height') - ->addParameterByName('max_img_height') - ->addParameterByName('logger'); - - $configurator->attributeFilters - ->add('#flashwidth', __NAMESPACE__ . '\\parser::filter_flash_width') - ->addParameterByName('max_img_width') - ->addParameterByName('logger'); - // Create a custom filter for phpBB's per-mode font size limits $configurator->attributeFilters ->add('#fontsize', __NAMESPACE__ . '\\parser::filter_font_size') @@ -306,8 +292,8 @@ class factory implements \phpbb\textformatter\cache_interface $configurator->tags['QUOTE']->nestingLimit = PHP_INT_MAX; } - // Modify the template to disable images/flash/mentions depending on user's settings - foreach (array('FLASH', 'IMG', 'MENTION') as $name) + // Modify the template to disable images/mentions depending on user's settings + foreach (['IMG', 'MENTION'] as $name) { $tag = $configurator->tags[$name]; $tag->template = '' . $tag->template . ''; diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php index d5cc14f50d..cf36879dbe 100644 --- a/phpBB/phpbb/textformatter/s9e/parser.php +++ b/phpBB/phpbb/textformatter/s9e/parser.php @@ -218,7 +218,7 @@ class parser implements \phpbb\textformatter\parser_interface { $errors[] = array($msg, $context['max_size']); } - else if (preg_match('/^MAX_(?:FLASH|IMG)_(HEIGHT|WIDTH)_EXCEEDED$/D', $msg, $m)) + else if (preg_match('/^MAX_IMG_(HEIGHT|WIDTH)_EXCEEDED$/D', $msg, $m)) { $errors[] = array($msg, $context['max_' . strtolower($m[1])]); } @@ -301,50 +301,6 @@ class parser implements \phpbb\textformatter\parser_interface } } - /** - * Filter a flash object's height - * - * @see bbcode_firstpass::bbcode_flash() - * - * @param string $height - * @param integer $max_height - * @param Logger $logger - * @return mixed Original value if valid, FALSE otherwise - */ - public static function filter_flash_height($height, $max_height, Logger $logger) - { - if ($max_height && $height > $max_height) - { - $logger->err('MAX_FLASH_HEIGHT_EXCEEDED', array('max_height' => $max_height)); - - return false; - } - - return $height; - } - - /** - * Filter a flash object's width - * - * @see bbcode_firstpass::bbcode_flash() - * - * @param string $width - * @param integer $max_width - * @param Logger $logger - * @return mixed Original value if valid, FALSE otherwise - */ - public static function filter_flash_width($width, $max_width, Logger $logger) - { - if ($max_width && $width > $max_width) - { - $logger->err('MAX_FLASH_WIDTH_EXCEEDED', array('max_width' => $max_width)); - - return false; - } - - return $width; - } - /** * Filter the value used in a [size] BBCode * diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php index 64875d96fc..61eb5fc141 100644 --- a/phpBB/phpbb/textformatter/s9e/renderer.php +++ b/phpBB/phpbb/textformatter/s9e/renderer.php @@ -48,11 +48,6 @@ class renderer implements \phpbb\textformatter\renderer_interface */ protected $viewcensors = false; - /** - * @var bool Status of the viewflash option - */ - protected $viewflash = false; - /** * @var bool Status of the viewimg option */ @@ -167,7 +162,7 @@ class renderer implements \phpbb\textformatter\renderer_interface /** * Configure this renderer as per the user's settings * - * Should set the locale as well as the viewcensor/viewflash/viewimg/viewsmilies options. + * Should set the locale as well as the viewcensor/viewimg/viewsmilies options. * * @param \phpbb\user $user * @param \phpbb\config\config $config @@ -179,7 +174,6 @@ class renderer implements \phpbb\textformatter\renderer_interface $censor = $user->optionget('viewcensors') || !$config['allow_nocensors'] || !$auth->acl_get('u_chgcensors'); $this->set_viewcensors($censor); - $this->set_viewflash($user->optionget('viewflash')); $this->set_viewimg($user->optionget('viewimg')); $this->set_viewsmilies($user->optionget('viewsmilies')); $this->set_usemention($config['allow_mentions'] && $auth->acl_get('u_mention')); @@ -221,14 +215,6 @@ class renderer implements \phpbb\textformatter\renderer_interface return $this->viewcensors; } - /** - * {@inheritdoc} - */ - public function get_viewflash() - { - return $this->viewflash; - } - /** * {@inheritdoc} */ @@ -310,15 +296,6 @@ class renderer implements \phpbb\textformatter\renderer_interface $this->renderer->setParameter('S_VIEWCENSORS', $value); } - /** - * {@inheritdoc} - */ - public function set_viewflash($value) - { - $this->viewflash = $value; - $this->renderer->setParameter('S_VIEWFLASH', $value); - } - /** * {@inheritdoc} */ diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php index 2ee6ea2cb3..bd7b6c9fc9 100644 --- a/phpBB/phpbb/textreparser/base.php +++ b/phpBB/phpbb/textreparser/base.php @@ -77,7 +77,7 @@ abstract class base implements reparser_interface // Those BBCodes are disabled based on context and user permissions and that value is never // stored in the database. Here we test whether they were used in the original text. - $bbcodes = array('flash', 'img', 'quote', 'url'); + $bbcodes = array('img', 'quote', 'url'); foreach ($bbcodes as $bbcode) { $field_name = 'enable_' . $bbcode . '_bbcode'; @@ -253,7 +253,6 @@ abstract class base implements reparser_interface $unparsed['enable_magic_url'], $unparsed['enable_smilies'], $unparsed['enable_img_bbcode'], - $unparsed['enable_flash_bbcode'], $unparsed['enable_quote_bbcode'], $unparsed['enable_url_bbcode'], 'text_reparser.' . $this->get_name() diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 6b3b2044e5..ec3c4b74be 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -49,7 +49,7 @@ class user extends \phpbb\session protected $is_setup_flag; // Able to add new options (up to id 31) - var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); + var $keyoptions = array('viewimg' => 0, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); public $profile_fields; diff --git a/phpBB/posting.php b/phpBB/posting.php index 696c3346cb..e65012b343 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -721,12 +721,11 @@ if ($mode == 'edit' && $post_data['bbcode_uid']) $message_parser->bbcode_uid = $post_data['bbcode_uid']; } -// HTML, BBCode, Smilies, Images and Flash status +// HTML, BBCode, Smilies and Images 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; /** @@ -770,7 +769,7 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( if (confirm_box(true)) { $message_parser->message = $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']); + $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $quote_status, $config['allow_post_links']); $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => (int) $user->data['user_id'], @@ -1109,7 +1108,7 @@ if ($submit || $preview || $refresh) 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']); + $message_parser->parse($post_data['enable_bbcode'], ($config['allow_post_links']) ? $post_data['enable_urls'] : false, $post_data['enable_smilies'], $img_status, $quote_status, $config['allow_post_links']); } // On a refresh we do not care about message parsing errors @@ -1891,7 +1890,6 @@ $page_data = array( 'MESSAGE' => $post_data['post_text'], 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : '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'], @@ -1938,7 +1936,6 @@ $page_data = array( '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, diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html index 2780d869d2..583b764b2c 100644 --- a/phpBB/styles/prosilver/template/bbcode.html +++ b/phpBB/styles/prosilver/template/bbcode.html @@ -91,5 +91,3 @@ - - diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index 049c81b07e..72b1076a67 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -7,7 +7,7 @@ // Define the bbCode tags var bbcode = new Array(); - var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]', {custom_tags.BBCODE_NAME}); + var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[size=]','[/size]', {custom_tags.BBCODE_NAME}); var imageTag = false; function change_palette() @@ -78,11 +78,6 @@ {{ Icon('iconify', 'mdi:link-variant', '', true, 'c-button-icon') }} - - - diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index db543461b5..a64974d8b4 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -65,7 +65,6 @@ {BBCODE_STATUS}
{IMG_STATUS}
- {FLASH_STATUS}
{URL_STATUS}
{SMILIES_STATUS} diff --git a/phpBB/styles/prosilver/template/ucp_prefs_view.html b/phpBB/styles/prosilver/template/ucp_prefs_view.html index ae3d7a3c85..659bb3b129 100644 --- a/phpBB/styles/prosilver/template/ucp_prefs_view.html +++ b/phpBB/styles/prosilver/template/ucp_prefs_view.html @@ -17,13 +17,6 @@ -
-
-
- - -
-
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php index 5aa829f37d..f5f11ae900 100644 --- a/tests/bbcode/parser_test.php +++ b/tests/bbcode/parser_test.php @@ -211,11 +211,6 @@ class phpbb_bbcode_parser_test extends \phpbb_test_case '[quote="[img]https://area51.phpbb.com/images/area51.png[/img]"]test[/quote]', '[quote="[img:]https://area51.phpbb.com/images/area51.png[/img:]":]test[/quote:]', ), - array( - 'Disallow flash bbcodes in usernames - Username displayed as [flash]http://www.phpbb.com/[/flash]', - '[quote="[flash]http://www.phpbb.com/[/flash]"]test[/quote]', - '[quote="[flash]http://www.phpbb.com/[/flash]":]test[/quote:]', - ), array( 'Disallow quote bbcodes in usernames - Username displayed as [quote]test[/quote]', '[quote="[quote]test[/quote]"]test[/quote]', diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 71838bd120..b522866a40 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -582,7 +582,6 @@ class phpbb_test_case_helpers $user->date_format = 'Y-m-d H:i:s'; $user->optionset('viewcensors', true); - $user->optionset('viewflash', true); $user->optionset('viewimg', true); $user->optionset('viewsmilies', true); $user->timezone = new \DateTimeZone('UTC'); diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index d9ba86b05d..6e2de36058 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -87,7 +87,6 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case $this->assertTrue(isset($configurator->BBCodes['CODE'])); $this->assertTrue(isset($configurator->BBCodes['COLOR'])); $this->assertTrue(isset($configurator->BBCodes['EMAIL'])); - $this->assertTrue(isset($configurator->BBCodes['FLASH'])); $this->assertTrue(isset($configurator->BBCodes['I'])); $this->assertTrue(isset($configurator->BBCodes['IMG'])); $this->assertTrue(isset($configurator->BBCodes['LIST'])); diff --git a/tests/text_formatter/s9e/fixtures/styles/bar/template/bbcode.html b/tests/text_formatter/s9e/fixtures/styles/bar/template/bbcode.html index 76a35542be..a3c8bff613 100644 --- a/tests/text_formatter/s9e/fixtures/styles/bar/template/bbcode.html +++ b/tests/text_formatter/s9e/fixtures/styles/bar/template/bbcode.html @@ -36,5 +36,3 @@ {DESCRIPTION} {DESCRIPTION} - - diff --git a/tests/text_formatter/s9e/fixtures/styles/barplus/template/bbcode.html b/tests/text_formatter/s9e/fixtures/styles/barplus/template/bbcode.html index fad8d828fd..4bc2ed1054 100644 --- a/tests/text_formatter/s9e/fixtures/styles/barplus/template/bbcode.html +++ b/tests/text_formatter/s9e/fixtures/styles/barplus/template/bbcode.html @@ -36,5 +36,3 @@ {DESCRIPTION} {DESCRIPTION} - - diff --git a/tests/text_formatter/s9e/fixtures/styles/foo/template/bbcode.html b/tests/text_formatter/s9e/fixtures/styles/foo/template/bbcode.html index 3e38d13a32..011230155d 100644 --- a/tests/text_formatter/s9e/fixtures/styles/foo/template/bbcode.html +++ b/tests/text_formatter/s9e/fixtures/styles/foo/template/bbcode.html @@ -36,5 +36,3 @@ {DESCRIPTION} {DESCRIPTION} - - diff --git a/tests/text_formatter/s9e/fixtures/styles/prosilver/template/bbcode.html b/tests/text_formatter/s9e/fixtures/styles/prosilver/template/bbcode.html index 6544b43bfd..9c3d55f598 100644 --- a/tests/text_formatter/s9e/fixtures/styles/prosilver/template/bbcode.html +++ b/tests/text_formatter/s9e/fixtures/styles/prosilver/template/bbcode.html @@ -74,5 +74,3 @@ {% for url in loops.url %}{{ DESCRIPTION }}{% endfor %} {% for email in loops.email %}{{ DESCRIPTION }}{% endfor %} - -{% for flash in loops.flash %}{% endfor %} diff --git a/tests/text_formatter/s9e/fixtures/styles/unsafe/template/bbcode.html b/tests/text_formatter/s9e/fixtures/styles/unsafe/template/bbcode.html index f3932f9b78..c99dba3e65 100644 --- a/tests/text_formatter/s9e/fixtures/styles/unsafe/template/bbcode.html +++ b/tests/text_formatter/s9e/fixtures/styles/unsafe/template/bbcode.html @@ -36,5 +36,3 @@ {DESCRIPTION} {DESCRIPTION} - - diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php index 69075ebaca..d0ca520ea0 100644 --- a/tests/text_formatter/s9e/renderer_test.php +++ b/tests/text_formatter/s9e/renderer_test.php @@ -106,11 +106,6 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case 'apple', array('set_viewcensors' => false) ), - array( - '[flash=123,456]http://example.org/foo.swf[/flash]', - '', - array('set_viewflash' => true) - ), array( '[img]http://example.org/foo.png[/img]', 'Image', @@ -214,26 +209,6 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case $phpbb_container->set('auth', $auth); } ), - array( - '[flash=123,456]http://localhost/foo.swf[/flash]', - '' - ), - array( - '[flash=123,456]http://localhost/foo.swf[/flash]', - 'http://localhost/foo.swf', - function ($phpbb_container) - { - global $phpbb_root_path, $phpEx; - - $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); - $lang = new \phpbb\language\language($lang_loader); - $user = new \phpbb\user($lang, '\phpbb\datetime'); - $user->data['user_options'] = 230271; - $user->optionset('viewflash', false); - - $phpbb_container->set('user', $user); - } - ), array( '[img]http://localhost/mrgreen.gif[/img]', 'Image' @@ -307,7 +282,6 @@ class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case { return array( array('viewcensors'), - array('viewflash'), array('viewimg'), array('viewsmilies') ); diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php index 64ab695c6e..9a909a007c 100644 --- a/tests/text_processing/generate_text_for_display_test.php +++ b/tests/text_processing/generate_text_for_display_test.php @@ -39,7 +39,6 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca $user = new \phpbb\user($lang, '\phpbb\datetime'); $user->data['user_options'] = 230271; $user->optionset('viewcensors', true); - $user->optionset('viewflash', true); $user->optionset('viewimg', true); $user->optionset('viewsmilies', true); @@ -159,27 +158,6 @@ class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_ca 'apple', false ), - array( - '[flash=123,456]http://localhost/foo.swf[/flash]', - '' - ), - array( - '[flash=123,456]http://localhost/foo.swf[/flash]', - 'http://localhost/foo.swf', - true, - function ($phpbb_container) - { - global $phpbb_root_path, $phpEx; - - $lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx); - $lang = new \phpbb\language\language($lang_loader); - $user = new \phpbb\user($lang, '\phpbb\datetime'); - $user->data['user_options'] = 230271; - $user->optionset('viewflash', false); - - $phpbb_container->set('user', $user); - } - ), array( '[img]http://localhost/mrgreen.gif[/img]', 'Image' diff --git a/tests/text_processing/generate_text_for_storage_test.php b/tests/text_processing/generate_text_for_storage_test.php index 68320ec7d1..c47c9b9f5e 100644 --- a/tests/text_processing/generate_text_for_storage_test.php +++ b/tests/text_processing/generate_text_for_storage_test.php @@ -32,7 +32,7 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca /** * @dataProvider get_text_formatter_tests */ - public function test_text_formatter($original, $expected, $allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_flash_bbcode, $allow_quote_bbcode, $allow_url_bbcode, $setup = null) + public function test_text_formatter($original, $expected, $allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_quote_bbcode, $allow_url_bbcode, $setup = null) { $actual = $original; $uid = ''; @@ -44,7 +44,7 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca $setup(); } - generate_text_for_storage($actual, $uid, $bitfield, $flags, $allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_flash_bbcode, $allow_quote_bbcode, $allow_url_bbcode); + generate_text_for_storage($actual, $uid, $bitfield, $flags, $allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_quote_bbcode, $allow_url_bbcode); $this->assertSame($expected, $actual); } @@ -61,7 +61,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca true, true, true, - true, ), array( 'Hello [url=http://example.org]world[/url] :)', @@ -72,7 +71,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca true, true, true, - true, ), array( '&<>"\'', @@ -83,7 +81,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca true, true, true, - true, ), array( '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', @@ -94,7 +91,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, ), array( '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', @@ -105,7 +101,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, ), array( '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', @@ -115,7 +110,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, true, ), array( @@ -127,7 +121,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, ), array( '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', @@ -138,16 +131,14 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca true, false, false, - false, ), array( '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', - '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', + '[b]..[/b] http://example.org :) [img]http://example.org/img.png[/img] [flash=123,123]http://example.org/flash.swf[/flash] [quote]...[/quote] [url]http://example.org[/url]', true, false, false, false, - true, false, false, ), @@ -158,7 +149,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, true, false, ), @@ -170,7 +160,6 @@ class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_ca false, false, false, - false, true, ), ); diff --git a/tests/text_processing/message_parser_test.php b/tests/text_processing/message_parser_test.php index 3b81ab9d9d..22496a8505 100644 --- a/tests/text_processing/message_parser_test.php +++ b/tests/text_processing/message_parser_test.php @@ -38,15 +38,12 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case $config = new \phpbb\config\config(array('max_poll_options' => 999)); $map = array( - array('MAX_FLASH_HEIGHT_EXCEEDED', 123, 'Your flash files may only be up to 123 pixels high.'), - array('MAX_FLASH_WIDTH_EXCEEDED', 456, 'Your flash files may only be up to 456 pixels wide.'), array('MAX_FONT_SIZE_EXCEEDED', 120, 'You may only use fonts up to size 120.'), array('MAX_FONT_SIZE_EXCEEDED', 200, 'You may only use fonts up to size 200.'), array('MAX_IMG_HEIGHT_EXCEEDED', 12, 'Your images may only be up to 12 pixels high.'), array('MAX_IMG_WIDTH_EXCEEDED', 34, 'Your images may only be up to 34 pixels wide.'), array('TOO_MANY_SMILIES', 3, 'Your message contains too many smilies. The maximum number of smilies allowed is 3.'), array('TOO_MANY_URLS', 2, 'Your message contains too many URLs. The maximum number of URLs allowed is 2.'), - array('UNAUTHORISED_BBCODE', '[flash]', 'You cannot use certain BBCodes: [flash].'), array('UNAUTHORISED_BBCODE', '[img]', 'You cannot use certain BBCodes: [img].'), array('UNAUTHORISED_BBCODE', '[quote]', 'You cannot use certain BBCodes: [quote].'), array('UNAUTHORISED_BBCODE', '[url]', 'You cannot use certain BBCodes: [url].'), @@ -112,7 +109,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case $this->assertSame( 'Me[i]s[/i]sage', - $message_parser->parse(true, true, true, true, true, true, true, false) + $message_parser->parse(true, true, true, true, true, true, false) ); $this->assertSame($warn_msg, $message_parser->warn_msg); @@ -155,23 +152,6 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case ), array('You cannot use certain BBCodes: [quote].') ), - array( - array( - 'poll_title' => 'xxx', - 'poll_option_text' => "[flash=12,34]http://example.org/x.swf[/flash]\n:)", - 'poll_max_options' => 2, - 'poll_options_size' => 2 - ), - array( - 'poll_title' => 'xxx', - 'poll_option_text' => "[flash=12,34]http://example.org/x.swf[/flash]\n:)", - 'poll_options' => array( - '[flash=12,34]http://example.org/x.swf[/flash]', - ':)' - ) - ), - array('You cannot use certain BBCodes: [flash].') - ), array( array( 'poll_title' => 'xxx', @@ -211,85 +191,78 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[b]bold[/b]', '[b]bold[/b]', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( '[b]bold[/b]', '[b]bold[/b]', - array(false, true, true, true, true, true, true) + array(false, true, true, true, true, true) ), array( 'http://example.org', 'http://example.org', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( 'http://example.org', 'http://example.org', - array(true, false, true, true, true, true, true) + array(true, false, true, true, true, true) ), array( ':)', ':)', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( ':)', ':)', - array(true, true, false, true, true, true, true) + array(true, true, false, true, true, true) ), array( '[url=http://example.org][img]http://example.org/img.png[/img][/url]', '[url=http://example.org][img]http://example.org/img.png[/img][/url]', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( '[url=http://example.org][img]http://example.org/img.png[/img][/url]', '[url=http://example.org][img]http://example.org/img.png[/img][/url]', - array(true, true, true, false, true, true, true), + array(true, true, true, false, true, true), null, array('You cannot use certain BBCodes: [img].') ), - array( - '[flash=12,34]http://example.org/foo.swf[/flash]', - '[flash=12,34]http://example.org/foo.swf[/flash]', - array(true, true, true, true, true, true, true) - ), array( '[flash=12,34]http://example.org/foo.swf[/flash]', '[flash=12,34]http://example.org/foo.swf[/flash]', - array(true, true, true, true, false, true, true), - null, - array('You cannot use certain BBCodes: [flash].') + array(true, true, true, true, true, true) ), array( '[quote="foo"]bar :)[/quote]', '[quote="foo"]bar :)[/quote]', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( '[quote="foo"]bar :)[/quote]', '[quote="foo"]bar :)[/quote]', - array(true, true, true, true, true, false, true), + array(true, true, true, true, false, true), null, array('You cannot use certain BBCodes: [quote].') ), array( '[url=http://example.org][img]http://example.org/img.png[/img][/url]', '[url=http://example.org][img]http://example.org/img.png[/img][/url]', - array(true, true, true, true, true, true, true) + array(true, true, true, true, true, true) ), array( '[url=http://example.org][img]http://example.org/img.png[/img][/url]', '[url=http://example.org][img]http://example.org/img.png[/img][/url]', - array(true, true, true, true, true, true, false), + array(true, true, true, true, true, false), null, array('You cannot use certain BBCodes: [url].') ), array( '[size=200]200[/size]', '[size=200]200[/size]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_font_size', 200); @@ -298,7 +271,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[size=200]200[/size]', '[size=200]200[/size]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_font_size', 0); @@ -307,7 +280,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[size=2000]2000[/size]', '[size=2000]2000[/size]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_font_size', 200); @@ -317,7 +290,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[size=0]0[/size]', '[size=0]0[/size]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_font_size', 200); @@ -326,7 +299,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[size=200]200[/size]', '[size=200]200[/size]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_font_size', 200); @@ -335,7 +308,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[size=200]200[/size]', '[size=200]200[/size]', - array(true, true, true, true, true, true, true, true, 'sig'), + array(true, true, true, true, true, true, true, 'sig'), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_font_size', 120); @@ -345,7 +318,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[img]http://example.org/100x100.png[/img]', '[img]http://example.org/100x100.png[/img]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_img_height', 0); @@ -355,7 +328,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[img]http://example.org/100x100.png[/img]', '[img]http://example.org/100x100.png[/img]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_img_height', 100); @@ -365,37 +338,17 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( '[img]http://example.org/100x100.png[/img]', '[img]http://example.org/100x100.png[/img]', - array(true, true, true, true, true, true, true), + array(true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_img_height', 12); $phpbb_container->get('config')->set('max_sig_img_width', 34); } ), - array( - '[flash=999,999]http://example.org/foo.swf[/flash]', - '[flash=999,999]http://example.org/foo.swf[/flash]', - array(true, true, true, true, true, true, true), - function ($phpbb_container) - { - $phpbb_container->get('config')->set('max_post_img_height', 123); - }, - array('Your flash files may only be up to 123 pixels high.') - ), - array( - '[flash=999,999]http://example.org/foo.swf[/flash]', - '[flash=999,999]http://example.org/foo.swf[/flash]', - array(true, true, true, true, true, true, true), - function ($phpbb_container) - { - $phpbb_container->get('config')->set('max_post_img_width', 456); - }, - array('Your flash files may only be up to 456 pixels wide.') - ), array( ':) :) :)', ':) :) :)', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_smilies', 3); @@ -404,7 +357,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( ':) :) :) :)', ':) :) :) :)', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_smilies', 3); @@ -414,7 +367,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( ':) :) :) :)', ':) :) :) :)', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_smilies', 0); @@ -423,7 +376,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( ':) :) :) :)', ':) :) :) :)', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_smilies', 3); @@ -432,7 +385,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( ':) :) :) :)', ':) :) :) :)', - array(true, true, true, true, true, true, true, true, 'sig'), + array(true, true, true, true, true, true, true, 'sig'), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_smilies', 3); @@ -442,7 +395,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( 'http://example.org http://example.org http://example.org', 'http://example.org http://example.org http://example.org', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_urls', 2); @@ -452,7 +405,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( 'http://example.org http://example.org http://example.org', 'http://example.org http://example.org http://example.org', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_post_urls', 0); @@ -461,7 +414,7 @@ class phpbb_text_processing_message_parser_test extends phpbb_test_case array( 'http://example.org http://example.org http://example.org', 'http://example.org http://example.org http://example.org', - array(true, true, true, true, true, true, true, true), + array(true, true, true, true, true, true, true), function ($phpbb_container) { $phpbb_container->get('config')->set('max_sig_urls', 2); diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php index 700bead7e5..80fe85c8d3 100644 --- a/tests/text_reparser/plugins/test_row_based_plugin.php +++ b/tests/text_reparser/plugins/test_row_based_plugin.php @@ -117,20 +117,6 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t ), ) ), - array( - 6, - 7, - array( - array( - 'id' => '6', - 'text' => '[flash=123,345]http://example.org/flash.swf[/flash]', - ), - array( - 'id' => '7', - 'text' => '[flash=123,345]http://example.org/flash.swf[/flash]', - ), - ) - ), array( 8, 9,