PEAR::HTML_BBCodeParser Upgrade 1.1 to 1.2.2
Problem #1 - “[notice] child pid 13449 exit signal Segmentation fault (11)”
On a OpenBSD v3.7 i386 system running Apache v1.3.29 (not chrooted) with PHP v5.1.4 I upgraded HTML_BBCodeParser from version 1.1 to version 1.2.2 by running at command line “pear upgrade-all”. After the upgrades were complete the web site would not load a web page anymore. I looked at my HTTPD server logs and noticed I was receiving the following error message in error_log file, “[notice] child pid 13449 exit signal Segmentation fault (11)” whenever there was a HTTP request on port 80 or 443 to the web site. I couldn’t understand what the problem could be but then decided to uninstall HTML_BBCodeParser v1.2.2 and re-install HTML_BBCodeParser v1.1 to see if the web site would still function. Indeed the web site did load and function fine. So I decided to uninstall and install each version up to v1.2.2 to see where the breaking point was. As soon as the latest version of HTML_BBCodeParser v1.2.2 is installed the web site stops functioning. I was able to determine that there was something that has changed in v1.2.2 or something I did wrong in the Filters I created and existing filters I altered.
Solution #1
I uninstalled HTML_BBCodeParser then manually removed the directory /usr/local/lib/php/HTML/HTML_BBCodeParser. Then I installed HTML_BBCodeParser v1.2.2 and copied the BBCodeParser.ini example from /usr/local/lib/php/doc/HTML_BBCodeParser/BBCodeParser/example/ to /usr/local/lib/php/HTML/BBCodeParse/. After that the web site functioned as normal again.
Problem #2 - “Warning: strpos() [function.strpos]: Empty delimiter.”
However I discovered that when using PHP 5 one has to alter the BBCodeParser.ini file otherwise you will receive the following warning message when trying to load a web page using HTML_BBCodeParser, “Warning: strpos() [function.strpos]: Empty delimiter. in /usr/local/lib/php/HTML/BBCodeParser.php on line 354″.
Solution #2
Edit your BBCodeParser.ini and alter the line for the opening tag character and closing tag character to be enclosed by double quotes around the square brackets, [ and ]. Apparently this has been an issue for awhile now, http://pear.php.net/bugs/bug.php?id=2580.
Example After Alteration - BBCodeParser.ini
[HTML_BBCodeParser]
; possible values: single|double
; use single or double quotes for attributes
quotestyle = single
; possible values: all|nothing|strings
; quote all attribute values, none, or only the strings
quotewhat = all
; the opening tag character
open = "["
; the closing tag character
close = "]"
; possible values: true|false
; use xml style closing tags for single html tags ( or
)
xmlclose = true
; possible values: a comma seperated list of filters
; comma seperated list of filters to use
filters = Basic,Extended,Links,Images,Lists,Email


July 26th, 2007 at 4:41 am
Hey The warden, can you contact me via email, i want to the consult with you on your recent experiences with HTML_BBCodeParser. I am on the fireboard core dev team and looking to implement it to replace our outdated js based parser.
Thanks Bruv,
Dan