diff --git a/fp-plugins/bbcode/inc/stringparser_bbcode.class.php b/fp-plugins/bbcode/inc/stringparser_bbcode.class.php index f1b4db8..549ab61 100755 --- a/fp-plugins/bbcode/inc/stringparser_bbcode.class.php +++ b/fp-plugins/bbcode/inc/stringparser_bbcode.class.php @@ -156,12 +156,9 @@ class StringParser_BBCode extends StringParser { * @return bool */ function addCode ($name, $callback_type, $callback_func, $callback_params, $content_type, $allowed_within, $not_allowed_within) { - // allow override - /* if (isset ($this->_codes[$name])) { return false; // already exists } - */ if (!preg_match ('/^[a-zA-Z0-9*_!+-]+$/', $name, $code)) { return false; // invalid } diff --git a/fp-plugins/bbcode/plugin.bbcode.php b/fp-plugins/bbcode/plugin.bbcode.php index 7eafacd..4cbfab1 100644 --- a/fp-plugins/bbcode/plugin.bbcode.php +++ b/fp-plugins/bbcode/plugin.bbcode.php @@ -210,12 +210,12 @@ function do_bbcode_img ($action, $attributes, $content, $params, $node_object) { $height = (int)$attributes['height']; // if width or height are set we calc proportions }elseif (isset($attributes['width'])) { - $scalefact = ($attributes['width'] / $orig_w); + $scalefact = $orig_w? ($attributes['width'] / $orig_w) : 0; $width = (int) $attributes['width']; $height = (int) ($scalefact*$orig_h); }elseif (isset($attributes['height'])) { - $scalefact = ($attributes['height'] / $orig_h); + $scalefact = $orig_w? ($attributes['height'] / $orig_h) : 0; $height = (int) $attributes['height']; $width = (int) ($scalefact*$orig_w); }