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.140.2.74 -r1.140.2.75 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 22 Apr 2017 18:11:54 -0000 1.140.2.74 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 24 Apr 2017 15:53:45 -0000 1.140.2.75 @@ -550,6 +550,7 @@ -entire_form:boolean -no_empty:boolean {-base} + -base_encode:boolean {-anchor} {-exclude {}} {-override {}} @@ -694,6 +695,9 @@ along with a question mark (?), if the query is non-empty. so the returned string can be used directly in a link. This is only relevant to URL export. + @option base_encode Decides whether argument passed as base option will be + encoded by ad_urlencode_url proc + @author Lars Pind (lars@pinds.com) @creation-date December 7, 2000 } { @@ -928,18 +932,15 @@ if { $quotehtml_p } { set export_string [ns_quotehtml $export_string] } - + # Prepend with the base URL if { [info exists base] && $base ne "" } { - if { [string first ? $base] > -1 } { - # The base already has query vars; assume that the - # path up to this point is already correctly encoded. - set export_string $base[expr {$export_string ne "" ? "&$export_string" : ""}] - } else { - # The base has no query vars + # if required, encode url part as well + if {$base_encode_p} { set base [ad_urlencode_url $base] - set export_string $base[expr {$export_string ne "" ? "?$export_string" : ""}] } + + set export_string $base[expr {[string first ? $base] > -1 ? "&" : "?"}]$export_string } # Append anchor