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

ID: 14380
Updated by: daniel.oconnor@gmail.com
Reported By: detritus at blueyonder dot co dot uk
Summary: Image Filter does not generate alt by default
-Status: Verified
+Status: Closed
Type: Bug
Package: HTML_BBCodeParser
Package Version: 1.2.2
PHP Version: Irrelevant
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:

-Status: Verified
+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:
------------------------------------------------------------------------

[2008-09-15 22:34:02] cagecrawler

A quick and dirty solution is to change line 76:

------
$o."img=\"\$2\"\$1".$c.$o."/img".$c,
------

to the following:

------
$o."img=\"\$2\" alt=\"\"\$1".$c.$o."/img".$c,
------

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

[2008-07-26 09:23:39] doconnor

(don't forget the require_once)
<?php
require_once 'HTML/BBCodeParser.php';

$parser = new HTML_BBCodeParser();
$parser->addFilter('Images');
echo $parser->qparse('[img]example.png[/img]');

echo $parser->qparse('[img alt=Example image]example.png[/img]');

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

[2008-07-21 13:19:01] detritus

Description:
------------
The Image Filter ([img][/img]) does not currently create a default
alternative text (alt="") resulting in common usage of image BB code
being non-standard compliant XHTML 1.0.

Test script:
---------------
<?php
$parser = new HTML_BBCodeParser();
$parser->addFilter('Images');
echo $parser->qparse('[img]example.png[/img]');

echo $parser->qparse('[img alt=Example image]example.png[/img]');
?>

Expected result:
----------------
<img src="example.png" alt="" />
<img src="example.png" alt="Example Image" />

Actual result:
--------------
<img src="example.png" />
<img src="example.png" alt="Example Image" />

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

Search Discussions

  • Detritus at Jan 2, 2012 at 3:24 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=14380&edit=1

    ID: 14380
    Comment by: detritus@blueyonder.co.uk
    Reported By: detritus at blueyonder dot co dot uk
    Summary: Image Filter does not generate alt by default
    Status: Closed
    Type: Bug
    Package: HTML_BBCodeParser
    Package Version: 1.2.2
    PHP Version: Irrelevant
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    Nearly 4 years to fix one line of code. Impressive. :D


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

    [2012-01-02 03:19:00] doconnor

    -Status: Verified
    +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.

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

    [2008-09-15 22:34:02] cagecrawler

    A quick and dirty solution is to change line 76:

    ------
    $o."img=\"\$2\"\$1".$c.$o."/img".$c,
    ------

    to the following:

    ------
    $o."img=\"\$2\" alt=\"\"\$1".$c.$o."/img".$c,
    ------

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

    [2008-07-26 09:23:39] doconnor

    (don't forget the require_once)
    <?php
    require_once 'HTML/BBCodeParser.php';

    $parser = new HTML_BBCodeParser();
    $parser->addFilter('Images');
    echo $parser->qparse('[img]example.png[/img]');

    echo $parser->qparse('[img alt=Example image]example.png[/img]');

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

    [2008-07-21 13:19:01] detritus

    Description:
    ------------
    The Image Filter ([img][/img]) does not currently create a default
    alternative text (alt="") resulting in common usage of image BB code
    being non-standard compliant XHTML 1.0.

    Test script:
    ---------------
    <?php
    $parser = new HTML_BBCodeParser();
    $parser->addFilter('Images');
    echo $parser->qparse('[img]example.png[/img]');

    echo $parser->qparse('[img alt=Example image]example.png[/img]');
    ?>

    Expected result:
    ----------------
    <img src="example.png" alt="" />
    <img src="example.png" alt="Example Image" />

    Actual result:
    --------------
    <img src="example.png" />
    <img src="example.png" alt="Example Image" />

    ------------------------------------------------------------------------
  • Daniel Oconnor at Jan 2, 2012 at 10:02 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=14380&edit=1

    ID: 14380
    Updated by: daniel.oconnor@gmail.com
    Reported By: detritus at blueyonder dot co dot uk
    Summary: Image Filter does not generate alt by default
    Status: Closed
    Type: Bug
    Package: HTML_BBCodeParser
    Package Version: 1.2.2
    PHP Version: Irrelevant
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    ... out of 12-16 million lines.
    https://www.ohloh.net/p/pear/analyses/latest


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

    [2012-01-02 16:24:39] detritus

    Nearly 4 years to fix one line of code. Impressive. :D

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

    [2012-01-02 03:19:00] doconnor

    -Status: Verified
    +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.

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

    [2008-09-15 22:34:02] cagecrawler

    A quick and dirty solution is to change line 76:

    ------
    $o."img=\"\$2\"\$1".$c.$o."/img".$c,
    ------

    to the following:

    ------
    $o."img=\"\$2\" alt=\"\"\$1".$c.$o."/img".$c,
    ------

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

    [2008-07-26 09:23:39] doconnor

    (don't forget the require_once)
    <?php
    require_once 'HTML/BBCodeParser.php';

    $parser = new HTML_BBCodeParser();
    $parser->addFilter('Images');
    echo $parser->qparse('[img]example.png[/img]');

    echo $parser->qparse('[img alt=Example image]example.png[/img]');

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

    [2008-07-21 13:19:01] detritus

    Description:
    ------------
    The Image Filter ([img][/img]) does not currently create a default
    alternative text (alt="") resulting in common usage of image BB code
    being non-standard compliant XHTML 1.0.

    Test script:
    ---------------
    <?php
    $parser = new HTML_BBCodeParser();
    $parser->addFilter('Images');
    echo $parser->qparse('[img]example.png[/img]');

    echo $parser->qparse('[img alt=Example image]example.png[/img]');
    ?>

    Expected result:
    ----------------
    <img src="example.png" alt="" />
    <img src="example.png" alt="Example Image" />

    Actual result:
    --------------
    <img src="example.png" />
    <img src="example.png" alt="Example Image" />

    ------------------------------------------------------------------------
  • Detritus at Jan 2, 2012 at 11:56 pm
    Edit report at https://pear.php.net/bugs/bug.php?id=14380&edit=1

    ID: 14380
    Updated by: detritus@blueyonder.co.uk
    Reported By: detritus at blueyonder dot co dot uk
    Summary: Image Filter does not generate alt by default
    Status: Closed
    Type: Bug
    Package: HTML_BBCodeParser
    Package Version: 1.2.2
    PHP Version: Irrelevant
    Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    It was meant in the context of this package only.
    Regardless, thank you for the fixes!


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

    [2012-01-02 23:03:03] doconnor

    ... out of 12-16 million lines.
    https://www.ohloh.net/p/pear/analyses/latest

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

    [2012-01-02 16:24:39] detritus

    Nearly 4 years to fix one line of code. Impressive. :D

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

    [2012-01-02 03:19:00] doconnor

    -Status: Verified
    +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.

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

    [2008-09-15 22:34:02] cagecrawler

    A quick and dirty solution is to change line 76:

    ------
    $o."img=\"\$2\"\$1".$c.$o."/img".$c,
    ------

    to the following:

    ------
    $o."img=\"\$2\" alt=\"\"\$1".$c.$o."/img".$c,
    ------

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

    [2008-07-26 09:23:39] doconnor

    (don't forget the require_once)
    <?php
    require_once 'HTML/BBCodeParser.php';

    $parser = new HTML_BBCodeParser();
    $parser->addFilter('Images');
    echo $parser->qparse('[img]example.png[/img]');

    echo $parser->qparse('[img alt=Example image]example.png[/img]');

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

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=14380

Related Discussions

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

People

Translate

site design / logo © 2022 Grokbase