template::data::validate::richtext (public)

 template::data::validate::richtext value_ref message_ref

Defined in packages/acs-templating/tcl/richtext-procs.tcl

Validate richtext after form submission.

Parameters:
value_ref (required)
Reference variable to the submitted value
message_ref (required)
Reference variable for returning an error message
Returns:
True (1) if the submitted data is valid, false (0) if not

Partial Call Graph (max 5 caller/called nodes):
%3 ad_html_security_check ad_html_security_check (public) template::data::validate::text template::data::validate::text (public) template::util::richtext::formats template::util::richtext::formats (public) template::data::validate::richtext template::data::validate::richtext template::data::validate::richtext->ad_html_security_check template::data::validate::richtext->template::data::validate::text template::data::validate::richtext->template::util::richtext::formats

Testcases:
No testcase defined.
Source code:

    upvar 2 $message_ref message $value_ref richtext_list
    lassign $richtext_list contents format

    if { $format ni [template::util::richtext::formats] } {
        set message "Invalid format '[ns_quotehtml $format]'."
        return 0
    }

    # enhanced text and HTML needs to be security checked
    if { $format in { text/enhanced text/html } } {

        set check_result [ad_html_security_check $contents]
        if { $check_result ne "" } {
            set message $check_result
            return 0
        }
    }

    return 1
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: