diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-04-12 16:20:39 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-04-12 16:20:39 +0000 |
commit | b63745fdb3b775d7505f38ed03a8bb39907a825c (patch) | |
tree | 3c2bc96535a30d66df3fdf6b3307be469d4362bd /phpBB/includes/message_parser.php | |
parent | f0868d37dfd73df6c2dfd76362af6c09b6b49a5f (diff) | |
download | forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.gz forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.bz2 forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.xz forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.zip |
my take on getting the bugs down... thanks to those also providing (usable) solutions to the problem. ;) Of course also to those reporting generally...
git-svn-id: file:///svn/phpbb/trunk@7330 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r-- | phpBB/includes/message_parser.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 97e977a42b..44bebc20c6 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -200,6 +200,8 @@ class bbcode_firstpass extends bbcode 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 . ']' . $in . '[/size]'; } return '[size=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/size:' . $this->bbcode_uid . ']'; @@ -270,6 +272,7 @@ class bbcode_firstpass extends bbcode } $in = trim($in); + $error = false; if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width']) { @@ -277,23 +280,26 @@ class bbcode_firstpass extends bbcode if ($stats === false) { + $error = true; $this->warn_msg[] = $user->lang['UNABLE_GET_IMAGE_SIZE']; } else { if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1]) { + $error = true; $this->warn_msg[] = 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]) { + $error = true; $this->warn_msg[] = sprintf($user->lang['MAX_IMG_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); } } } - if ($this->path_in_domain($in)) + if ($error || $this->path_in_domain($in)) { return '[img]' . $in . '[/img]'; } @@ -314,22 +320,25 @@ class bbcode_firstpass extends bbcode } $in = trim($in); + $error = false; // 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[] = sprintf($user->lang['MAX_FLASH_HEIGHT_EXCEEDED'], $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[] = sprintf($user->lang['MAX_FLASH_WIDTH_EXCEEDED'], $config['max_' . $this->mode . '_img_width']); } } - if ($this->path_in_domain($in)) + if ($error || $this->path_in_domain($in)) { return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]'; } |