FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16219&edit=1

ID: 16219
Comment by: hdc
Reported By: hdc at ngs dot ru
Summary: [size=9] Doesn't work (int > 9 does)
Status: Open
Type: Bug
Package: HTML_BBCodeParser
Package Version: 1.2.2
PHP Version: 5.2.9
New Comment:

I confirm, [size=9] does not work.
Problem is in regex of splitting tag string to attributes - it requires
at least two characters for unquoted attributes (except url tag).

Idea of fix - to change way of forming list of not allowed charaters of
tag attributes.

Also, it is ok to use '=' sign for attribute of img tag.

--- BBCodeParser.php.orig 2012-09-14 04:17:33.000000000 +0700
+++ BBCodeParser.php 2012-09-16 21:01:11.000000000 +0700
@@ -456,11 +456,11 @@
// tnx to Onno for the regex
// validate the arguments
$attributeArray = array();
- $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce]";
- if ($tag['tag'] != 'url') {
- $regex .= "[^=]";
+ $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce";
+ if (($tag['tag'] != 'url') && ($tag['tag'] != 'img')) {
+ $regex .= "=";
}
- $regex .= "+)(?=[\s$ce])!i";
+ $regex .= "]+)(?=[\s$ce])!i";
preg_match_all($regex, $str, $attributeArray,
PREG_SET_ORDER);
foreach ($attributeArray as $attribute) {
$attNam = strtolower($attribute[1]);


Previous Comments:
------------------------------------------------------------------------

[2009-05-23 19:09:06] doconnor

Hey Drew, are you able to add in a small executable example?

------------------------------------------------------------------------

[2009-05-11 21:53:12] dmagnetic

Description:
------------
[size=9]Some size 9 text[/size]

Produces

<span>Some size 9 text</span>

So no font-size is being applied. As soon as the font-size is
10+ it works fine.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 16, '12 at 6:00p
activeSep 16, '12 at 6:00p
posts1
users1
websitepear.php.net

1 user in discussion

Hdc: 1 post

People

Translate

site design / logo © 2022 Grokbase