Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -N -r1.118.2.49 -r1.118.2.50 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 28 Jun 2017 21:13:23 -0000 1.118.2.49 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 30 Jun 2017 14:13:09 -0000 1.118.2.50 @@ -590,7 +590,8 @@ return filter_return } set ad_conn_url [ad_conn url] - + ad_conn -set vhost_url $ad_conn_url + if {[string first [encoding convertto utf-8 \x00] $ad_conn_url] > -1} { ad_log warning "BAD CHAR in URL $ad_conn_url // rp_filter $why" # reset [ad_conn url], otherwise we might run into a problem when rendering the error page @@ -670,6 +671,7 @@ # Normal case: Prepend the root to the URL. # 3. set the intended URL ad_conn -set url ${root}${ad_conn_url} + ad_conn -set vhost_url ${ad_conn_url} set ad_conn_url [ad_conn url] # 4. set urlv and urlc for consistency @@ -736,7 +738,8 @@ } else { if {$node(url) eq "$ad_conn_url/"} { - ad_returnredirect $node(url) + #ad_returnredirect $node(url) + ad_returnredirect [ad_conn vhost_url]/ rp_debug "rp_filter: returnredirect $node(url)" rp_debug "rp_filter: return filter_return" return filter_return @@ -1377,7 +1380,10 @@ system_p, token, untrusted_user_id, - user_id. + user_id, + vhost_package_url, + vhost_subsite_url, + vhost_url.

Added recursion_count to properly deal with internalredirects. 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.80 -r1.140.2.81 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 30 Jun 2017 12:21:25 -0000 1.140.2.80 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 30 Jun 2017 14:13:09 -0000 1.140.2.81 @@ -2813,25 +2813,9 @@ so that programs that use this proc don't have to treat the root directory as a special case. } { - set path [ad_conn url] + set path [ad_conn vhost_url] - # - # Check, if we are in a subsite - # - util::split_location [util_current_location] current_proto current_host current_port - set host_node_id [ad_get_node_id_from_host_node_map $current_host] - if {$host_node_id > 0} { - # - # yes, we are. strip the subsite-prefix from the location - # - set site_node_path [site_node::get_url -node_id $host_node_id] - if {[string length $path] > [string length $site_node_path]} { - set path [string range $path [string length $site_node_path]-1 end] - ns_log notice "util_current_directory reduced path <$path>" - } - } - - set lastchar [string index $path end]/ + set lastchar [string index $path end] if {$lastchar eq "/" } { return $path } else {