From f95e730adf1d77e65cb4c408b49a62e2888b5f64 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 25 Feb 2006 05:46:52 +0000 Subject: Another one bites the dust :D - Nicer way of cleaning junk in PM export - Added various signature and posting controls :P git-svn-id: file:///svn/phpbb/trunk@5583 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'phpBB/includes/message_parser.php') diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 292ab36d76..eb37168fdd 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -155,11 +155,18 @@ class bbcode_firstpass extends bbcode function bbcode_size($stx, $in) { + global $user, $config; + if (!$this->check_bbcode('size', $in)) { return ''; } + if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx) + { + $this->warn_msg[] = sprintf($user->lang['MAX_FONT_SIZE_EXCEEDED'], $config['max_' . $this->mode . '_font_size']); + } + return '[size=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/size:' . $this->bbcode_uid . ']'; } @@ -205,11 +212,26 @@ class bbcode_firstpass extends bbcode function bbcode_img($in) { + global $user, $config; + if (!$this->check_bbcode('img', $in)) { return ''; } + if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) + { + $stats = getimagesize($in); + if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1]) + { + $this->warn_msg[] = sprintf($user->lang['MAX_IMG_HEIGHT_EXCEEDED'], $config['max_' . $this->mode . '_img_height']); + } + if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0]) + { + $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); + } + } + return '[img:' . $this->bbcode_uid . ']' . $in . '[/img:' . $this->bbcode_uid . ']'; } @@ -689,6 +711,8 @@ class parse_message extends bbcode_firstpass var $allow_flash_bbcode = true; var $allow_quote_bbcode = true; + var $mode; + // Init - give message here or manually function parse_message($message = '') { @@ -708,6 +732,8 @@ class parse_message extends bbcode_firstpass $mode = ($mode != 'post') ? 'sig' : 'post'; + $this->mode = $mode; + $this->allow_img_bbcode = $allow_img_bbcode; $this->allow_flash_bbcode = $allow_flash_bbcode; $this->allow_quote_bbcode = $allow_quote_bbcode; -- cgit v1.2.1