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 -N -r1.189.2.50 -r1.189.2.51 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 13 May 2020 08:07:28 -0000 1.189.2.50 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 13 May 2020 08:32:05 -0000 1.189.2.51 @@ -1689,7 +1689,7 @@ -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] + append result [ad_urlencode_folder_path $fullpath] } 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 -N -r1.71.2.22 -r1.71.2.23 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 13 Jan 2020 15:07:17 -0000 1.71.2.22 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 13 May 2020 08:32:05 -0000 1.71.2.23 @@ -460,7 +460,10 @@ aa_register_case \ -cats {api smoke} \ - -procs export_vars \ + -procs { + export_vars + ad_urlencode_url + } \ export_vars { Testing export_vars } { @@ -513,6 +516,35 @@ aa_equals "base without query vars" \ [export_vars -base $base {var1 var2}] \ "$base?$export_no_base" + + # Test just ad_urlencode_url (used by export_vars) + set url http://example.com/example + aa_equals "complex URL" \ + [ad_urlencode_url $url] \ + $url + + 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 + + # Test just ad_urlencode_url: location without trailing slash + set url http://example.com + aa_equals "URL with trailing slash" \ + [ad_urlencode_url $url] \ + $url/ + + # Test just ad_urlencode_url: location with trailing slash + set url http://example.com/ + aa_equals "URL without trailing slash" \ + [ad_urlencode_url $url] \ + $url + + # Test full qualified base without query vars + set base http://example.com/example + aa_equals "base without query vars" \ + [export_vars -base $base] \ + $base } aa_register_case \