ad_urlencode_url (public)
ad_urlencode_url url
Defined in packages/acs-tcl/tcl/utilities-procs.tcl
Perform an urlencode operation on a potentially full url (containing a location, but without query part).
- Parameters:
- url (required)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- export_vars
Source code: ad_try { # # Assign the components, and check if the URL is valid # set components [ns_parseurl $url] } on ok {r} { # # Assume the possibility that older ns_parseurl versions accepted a URL # without a scheme. # if {[dict exists $components proto]} { set result [util::join_location -proto [dict get $components proto] -hostname [dict get $components host] -port [expr {[dict exists $components port] ? [dict get $components port] : ""}] ] set path [dict get $components path] if {$path ne ""} { set path /$path } set tail [dict get $components tail] append result [ad_urlencode_folder_path $path/$tail] } else { # # No protocol, we encode it as a path # set result [ad_urlencode_folder_path $url] } } on error {errorMsg} { # # If the URL is not strictly valid, at least we try to encode it as a # path. # set result [ad_urlencode_folder_path $url] } return $resultXQL Not present: PostgreSQL, Oracle Generic XQL file: packages/acs-tcl/tcl/utilities-procs.xql