Use "ns_parsehtml" for speed and correctness when available
The new NaviServer built-in command "ns_parsehtml" is used on several occasions…
Show more
Use "ns_parsehtml" for speed and correctness when availableThe new NaviServer built-in command "ns_parsehtml" is used onseveral occasions in the code when available, namely in- util_close_html_tags- escaping disallowed HTML tags in ad_text_to_html- util_close_html_tagsThe command "util_close_html_tags" has a long history of troubles,since it was implemented originally based on regular expressions. Itwas reported in Jan 2009, that the function took on certain forumsentries 6 to 9 hours (e.g. /forums/message-view?message_id=357753) tofinish. Therefore, at this time a quick version based on tdom wasintroduced, which reduced at that time the performance to 7.3seconds. However, the tdom-based version tend to fail on invalid HTML,so it could cover only a few cases. The new "ns_parsehtml" is morerobust and works very stable on openacs.org with the know problemcases. Furthermore, this version is also significantly faster than thetdom version.
Show less