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 -r1.153.2.34 -r1.153.2.35 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 3 May 2021 08:55:27 -0000 1.153.2.34 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 23 May 2021 17:24:45 -0000 1.153.2.35 @@ -576,16 +576,31 @@ set ad_conn_url [ad_conn url] ad_conn -set vhost_url $ad_conn_url - if {[regexp {[^[:print:]]} $ad_conn_url]} { + # + # Check for invalid characters om the URL. + # + if {[regexp {[^[:print:]]} $ad_conn_url]} { ad_log warning "rp_filter: 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 + # + # Reset [ad_conn url], otherwise we might run into a problem + # when rendering the error page. + # ad_conn -set url ${root}/ ad_page_contract_handle_datasource_error "URL contains invalid characters" return filter_return } + # + # To test whether the URL chars are accepted by PostgreSQL, one + # might activate the following line. + # + # xo::dc get_value x "select 1 from cr_items where name = :ad_conn_url" + # if {[string length $ad_conn_url] > [parameter::get -package_id $::acs::kernel_id -parameter MaxUrlLength -default 2000]} { ad_log warning "rp_filter: URL TOO LONG: <$ad_conn_url> rp_filter $why" - # reset [ad_conn url], otherwise we might run into a problem when rendering the error page + # + # Reset [ad_conn url], otherwise we might run into a problem + # when rendering the error page. + # ad_conn -set url ${root}/ ad_page_contract_handle_datasource_error "URL is longer than allowed" return filter_return