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

ID: 12187
Updated by: [email protected]
Reported By: arjan at webpower dot nl
Summary: Quote recognition in parser is broken
-Status: Open
+Status: Closed
Type: Bug
Package: HTML_BBCodeParser
Operating System: Linux
Package Version: 1.2.2
PHP Version: 5.2.3
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: doconnor
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.




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

[2007-10-05 06:01:59] avoid

Description:
------------
The BBcode parser doesn't handle quotes (") around
attribute values correctly. If the attribute value contains
a space, things go awry.

I applied a simple patch to BBCodeParser.php, which fixes
the problem. Can somebody review this patch and, if found
okay, apply it to the source?

Line 459: removed a \s from the regexp:

Old: $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce]";
New: $regex = "![\s$oe]([a-z0-9]+)=(\"[^$ce]+\"|[^\s$ce]";

Line 463: Added the U pattern modifier, to make the regexp ungreedy.

Old: $regex .= "+)(?=[\s$ce])!i";
New: $regex .= "+)(?=[\s$ce])!iU";

Test script:
---------------
This is a line of text.
[url="http://www.example.com" title="this is a title"]

In this case, when trying to use the 'title' attribute,
it's value will be ""test" (with a leading quote).


Expected result:
----------------
Of course, the 'title' attribute should contain the value
"this is a test" (without the quotes).

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

Search Discussions

  • Daniel Oconnor at Jan 2, 2012 at 2:35 am
    Edit report at https://pear.php.net/bugs/bug.php?id=12187&edit=1

    ID: 12187
    Updated by: [email protected]
    Reported By: arjan at webpower dot nl
    Summary: Quote recognition in parser is broken
    -Status: Closed
    +Status: Open
    Type: Bug
    Package: HTML_BBCodeParser
    Operating System: Linux
    Package Version: 1.2.2
    PHP Version: 5.2.3
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -Status: Closed
    +Status: Open
    Actually, this fix breaks tests.


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

    [2012-01-02 03:11:51] doconnor

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

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

    [2007-10-05 06:01:59] avoid

    Description:
    ------------
    The BBcode parser doesn't handle quotes (") around
    attribute values correctly. If the attribute value contains
    a space, things go awry.

    I applied a simple patch to BBCodeParser.php, which fixes
    the problem. Can somebody review this patch and, if found
    okay, apply it to the source?

    Line 459: removed a \s from the regexp:

    Old: $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce]";
    New: $regex = "![\s$oe]([a-z0-9]+)=(\"[^$ce]+\"|[^\s$ce]";

    Line 463: Added the U pattern modifier, to make the regexp ungreedy.

    Old: $regex .= "+)(?=[\s$ce])!i";
    New: $regex .= "+)(?=[\s$ce])!iU";

    Test script:
    ---------------
    This is a line of text.
    [url="http://www.example.com" title="this is a title"]

    In this case, when trying to use the 'title' attribute,
    it's value will be ""test" (with a leading quote).


    Expected result:
    ----------------
    Of course, the 'title' attribute should contain the value
    "this is a test" (without the quotes).

    ------------------------------------------------------------------------
  • Daniel Oconnor at Jan 2, 2012 at 2:40 am
    Edit report at https://pear.php.net/bugs/bug.php?id=12187&edit=1

    ID: 12187
    Updated by: [email protected]
    Reported By: arjan at webpower dot nl
    Summary: Quote recognition in parser is broken
    Status: Assigned
    Type: Bug
    Package: HTML_BBCodeParser
    Operating System: Linux
    Package Version: 1.2.2
    PHP Version: 5.2.3
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    ... and title isn't a supported attribute.


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

    [2012-01-02 03:36:24] doconnor

    -Status: Closed
    +Status: Open
    Actually, this fix breaks tests.

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

    [2012-01-02 03:11:51] doconnor

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

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

    [2007-10-05 06:01:59] avoid

    Description:
    ------------
    The BBcode parser doesn't handle quotes (") around
    attribute values correctly. If the attribute value contains
    a space, things go awry.

    I applied a simple patch to BBCodeParser.php, which fixes
    the problem. Can somebody review this patch and, if found
    okay, apply it to the source?

    Line 459: removed a \s from the regexp:

    Old: $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce]";
    New: $regex = "![\s$oe]([a-z0-9]+)=(\"[^$ce]+\"|[^\s$ce]";

    Line 463: Added the U pattern modifier, to make the regexp ungreedy.

    Old: $regex .= "+)(?=[\s$ce])!i";
    New: $regex .= "+)(?=[\s$ce])!iU";

    Test script:
    ---------------
    This is a line of text.
    [url="http://www.example.com" title="this is a title"]

    In this case, when trying to use the 'title' attribute,
    it's value will be ""test" (with a leading quote).


    Expected result:
    ----------------
    Of course, the 'title' attribute should contain the value
    "this is a test" (without the quotes).

    ------------------------------------------------------------------------
  • Daniel Oconnor at Jan 2, 2012 at 2:40 am
    Edit report at https://pear.php.net/bugs/bug.php?id=12187&edit=1

    ID: 12187
    Updated by: [email protected]
    Reported By: arjan at webpower dot nl
    Summary: Quote recognition in parser is broken
    -Status: Assigned
    +Status: Wont fix
    Type: Bug
    Package: HTML_BBCodeParser
    Operating System: Linux
    Package Version: 1.2.2
    PHP Version: 5.2.3
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -Status: Assigned
    +Status: Wont fix



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

    [2012-01-02 03:40:56] doconnor

    ... and title isn't a supported attribute.

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

    [2012-01-02 03:36:24] doconnor

    -Status: Closed
    +Status: Open
    Actually, this fix breaks tests.

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

    [2012-01-02 03:11:51] doconnor

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

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

    [2007-10-05 06:01:59] avoid

    Description:
    ------------
    The BBcode parser doesn't handle quotes (") around
    attribute values correctly. If the attribute value contains
    a space, things go awry.

    I applied a simple patch to BBCodeParser.php, which fixes
    the problem. Can somebody review this patch and, if found
    okay, apply it to the source?

    Line 459: removed a \s from the regexp:

    Old: $regex = "![\s$oe]([a-z0-9]+)=(\"[^\s$ce]+\"|[^\s$ce]";
    New: $regex = "![\s$oe]([a-z0-9]+)=(\"[^$ce]+\"|[^\s$ce]";

    Line 463: Added the U pattern modifier, to make the regexp ungreedy.

    Old: $regex .= "+)(?=[\s$ce])!i";
    New: $regex .= "+)(?=[\s$ce])!iU";

    Test script:
    ---------------
    This is a line of text.
    [url="http://www.example.com" title="this is a title"]

    In this case, when trying to use the 'title' attribute,
    it's value will be ""test" (with a leading quote).


    Expected result:
    ----------------
    Of course, the 'title' attribute should contain the value
    "this is a test" (without the quotes).

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJan 2, '12 at 2:11a
activeJan 2, '12 at 2:40a
posts4
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 4 posts

People

Translate

site design / logo © 2023 Grokbase