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

Bug #2580 HTML_BBCodeParser example ini file needs quoted square brackets
Submitted: 2004-10-21 02:25 UTC
From: stoyan at videotron dot ca Assigned: sjr
Status: Closed Package: HTML_BBCodeParser
PHP Version: 5.0.1 OS: Win2K
Roadmaps: (Not assigned)    
Subscription  


 [2004-10-21 02:25 UTC] stoyan at videotron dot ca
Description: ------------ The example that goes together with the BBCodeParser package didn't work for me, because of a square bracket as a value in the suggested ini file. I quoted the bracket and it was fine. I tested with php 5.something on Windows, I don't know which php versions/OS are affected. But I think just quoting a value in an ini file won't break anything else, so it's safe that way. And thanks for the great package! Reproduce code: --------------- Proposed patch generated by cvs diff ? HTML_BBCodeParser.diff Index: BBCodeParser/example/BBCodeParser.ini =================================================================== RCS file: /repository/pear/HTML_BBCodeParser/BBCodeParser/example/BBCodeParser.ini,v retrieving revision 1.2 diff -u -r1.2 BBCodeParser.ini --- BBCodeParser/example/BBCodeParser.ini 13 Jan 2004 13:23:44 -0000 1.2 +++ BBCodeParser/example/BBCodeParser.ini 14 Oct 2004 15:38:40 -0000 @@ -9,10 +9,10 @@ quotewhat = all ; the opening tag character -open = [ +open = "[" ; the closing tag character -close = ] +close = "]" ; possible values: true|false ; use xml style closing tags for single html tags (<img> or <img />) Actual result: -------------- Error parsing the ini file.

Comments

 [2005-10-20 22:10 UTC] seth at pricepages dot org
I've fixed this bug and a number of others. Please take a look if you can, because I'd expect there to be new bugs in a rewrite of this size. (I'd call it version 2.0-beta) Link: http://pricepages.org/bbcode/BBCodeParser.zip * Unit tests! * More currently open bugs that have been fixed: 5609 4844 3447 1979 373 2580 3775 * I rewrote the _buildTagArray() function. It had been using half of the execution time in my tests. A TODO: in the comments said "rewrite this function". It is now almost 2x faster than the original function in my informal tests. * I rewrote _validateTagArray() in an effort to make it more useful and faster. Mission accomplished. It would be easier to read, too, but there is quite a bit more going on there. But commenting lines probably equal code lines. * Output should _always_ be XHTML 1.1 compatible. * Per discussion on the Developer list, you can now pass a flag that determines the action on an error or warning during parsing. Actions include: correcting the problem, aborting parsing, ignoring the invalid tag, and deleting the invalid tag. Examples: If you only accept valid input, set both warn and error to 'abort' and parsing will be aborted as soon as a problem is found. If you accept invalid feedback, but want to give the user feedback which tags caused problems, then set both error and warn to 'ignore' and the bad tags will be displayed. If you want to make the output as pretty as possible, then you want to auto correct when you can and delete when you can't. Set the options to delete on error, and correct on warn. (There are twelve combinations to fit various situations.) * I've attempted to maximize BC, but here are the only ways in which BC is broken (to my knowledge): Custom list numbering is now ignored for XHTML 1.1 reasons. I reverted back to single quotes by default. HTML is now automatically escaped to fix a few "bugs" (I believe that Text_Wiki also automatically escapes HTML). Old filters are incompatible with the new filters (the 'allowed' tag variable has been replaced with a more powerful set of variables and they use a different format). ~Seth