diff options
author | David M <davidmj@users.sourceforge.net> | 2006-02-25 05:46:52 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-02-25 05:46:52 +0000 |
commit | f95e730adf1d77e65cb4c408b49a62e2888b5f64 (patch) | |
tree | 98903248b26be5dae0c1548c097b5a3139c84db1 /phpBB/includes/message_parser.php | |
parent | 73a2c56104cdf97f35a0e1a417bbc3ec8e005050 (diff) | |
download | forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.gz forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.bz2 forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.tar.xz forums-f95e730adf1d77e65cb4c408b49a62e2888b5f64.zip |
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
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 26 |
1 files changed, 26 insertions, 0 deletions
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; |