template::data::validate::url (public)

 template::data::validate::url value_ref message_ref

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

Validate that a submitted url is correct. Accepts an optional http:// or https:// prefix, path, and query string.

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

Partial Call Graph (max 5 caller/called nodes):
%3 test_validate_url validate_url (test acs-templating) template::data::validate::url template::data::validate::url test_validate_url->template::data::validate::url _ _ (public) template::data::validate::url->_ util_url_valid_p util_url_valid_p (public) template::data::validate::url->util_url_valid_p

Testcases:
validate_url
Source code:

    upvar 2 $message_ref message $value_ref value

    set result [util_url_valid_p -relative $value]

    if { ! $result } {
        set message "[_ acs-templating.Invalid_url] \"[ns_quotehtml $value]\""
    }

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