util::external_url_p (public)
util::external_url_p url
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
check if this URL is external to the current host or a valid alternative valid alternatives include HTTPS or HTTP protocol change HTTP or HTTPS port number added or removed from current hostname or another hostname that the host responds to (from host_node_map)
- Parameters:
- url (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_page_contract_filters
Source code: set complete_url_p [util_complete_url_p $url] # # Only if the URL is syntactical a URL with a protocol, it might # be external. # if {$complete_url_p} { set external_url_p $complete_url_p # # If it has a protocol, we have to be able to find it in security::locations # set locations_list [security::locations] # more valid url pairs with host_node_map foreach location $locations_list { if {$location eq ""} { continue } set len [string length $location] #ns_log notice "util::external_url_p location match <$location/*> with <$url> sub <[string range $url 0 $len-1]>" if {[string range $url 0 $len-1] eq $location} { set external_url_p 0 break } } } else { try { set external_url_p [dict exists [ns_parseurl -strict $url] host] } on error {errorMsg} { set external_url_p 0 } } return $external_url_pXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql