html-conversion-procs.tcl

  • last updated 19 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
whitespace changes

  1. … 21 more files in changeset.
don't expect that invalid input becomes magically valid

Use "ns_parsehtml" for speed and correctness when available

The new NaviServer built-in command "ns_parsehtml" is used on

several occasions in the code when available, namely in

- util_close_html_tags

- escaping disallowed HTML tags in ad_text_to_html

- util_close_html_tags

The command "util_close_html_tags" has a long history of troubles,

since it was implemented originally based on regular expressions. It

was reported in Jan 2009, that the function took on certain forums

entries 6 to 9 hours (e.g. /forums/message-view?message_id=357753) to

finish. Therefore, at this time a quick version based on tdom was

introduced, which reduced at that time the performance to 7.3

seconds. However, the tdom-based version tend to fail on invalid HTML,

so it could cover only a few cases. The new "ns_parsehtml" is more

robust and works very stable on openacs.org with the know problem

cases. Furthermore, this version is also significantly faster than the

tdom version.

  1. … 1 more file in changeset.
improve spelling

  1. … 6 more files in changeset.
Deprecate ad_parameter_all_values_as_list: it does not provide much value and was also often use improperly

  1. … 4 more files in changeset.
Fixed bug in util_convert_line_breaks_to_html

The code deleted spaces around certain tags, while - according to the

documentation, only line breaks should be removed from there.

Extended regression test.

  1. … 1 more file in changeset.
Fix quote_unquote_html test

Make ad_html_security_check configurable

ad_html_security_check has now three optional attributes

to make it configurable for different situations

-allowed_tags

-allowed_attributes

-allowed_protocols

If these attributes are not specified, the behavior is exactly like

before. This change makes it also easier to regression test this

function, since the behavior does not necessarily depend on a site's

parameter settings.

The function was also modernized, new regression tests were added.

  1. … 1 more file in changeset.
improve listing of test coverage

  1. … 17 more files in changeset.
improve spelling

  1. … 16 more files in changeset.
improve comments and spelling

  1. … 2 more files in changeset.
Rename string_truncate and string_truncate_middle to comply with OpenACS naming convention, create deprecated wrappers, replace occurrences

As string_truncate_middle was defined in xotcl-request-monitor, bring it to acs-tcl instead

  1. … 11 more files in changeset.
provide a better name for link in test case

add "blob" to the checked attributes

  1. … 1 more file in changeset.
add checking for javascript and data protocols (fixes issue #3413)

  1. … 3 more files in changeset.
improve spelling

  1. … 14 more files in changeset.