Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.189.2.52 -r1.189.2.53 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 3 Jun 2020 18:02:02 -0000 1.189.2.52 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 3 Jun 2020 18:41:03 -0000 1.189.2.53 @@ -1679,15 +1679,19 @@ (containing a location, but without query part). @see ad_urlencode_folder_path } { - if {[util_complete_url_p $url]} { - set components [ns_parseurl $url] + set components [ns_parseurl $url] + 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 fullpath [dict get $components path]/[dict get $components tail] - append result [ad_urlencode_folder_path $fullpath] + 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 { set result [ad_urlencode_folder_path $url] } Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.71.2.25 -r1.71.2.26 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 3 Jun 2020 18:14:04 -0000 1.71.2.25 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 3 Jun 2020 18:41:03 -0000 1.71.2.26 @@ -530,7 +530,7 @@ set url http://example.com/foo=1/bar aa_equals "complex URL with char which has to be escaped" \ [ad_urlencode_url $url] \ - http://example.comfoo%3d1/bar + http://example.com/foo%3d1/bar # Test just ad_urlencode_url: location without trailing slash set url http://example.com