Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.4

Bug #14380 Image Filter does not generate alt by default
Submitted: 2008-07-21 17:19 UTC
From: detritus Assigned: doconnor
Status: Closed Package: HTML_BBCodeParser (version 1.2.2)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 19 + 33 = ?

 
 [2008-07-21 17:19 UTC] detritus (Andrew Collins)
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" />

Comments

 [2008-07-26 13:23 UTC] doconnor (Daniel O'Connor)
(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-09-16 02:34 UTC] cagecrawler (David Smith)
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, ------
 [2012-01-02 08:19 UTC] doconnor (Daniel O'Connor)
-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.
 [2012-01-02 21:24 UTC] detritus (Andrew Collins)
Nearly 4 years to fix one line of code. Impressive. :D
 [2012-01-03 04:03 UTC] doconnor (Daniel O'Connor)
... out of 12-16 million lines. https://www.ohloh.net/p/pear/analyses/latest
 [2012-01-03 05:57 UTC] detritus (Andrew Collins)
It was meant in the context of this package only. Regardless, thank you for the fixes!