Forum OpenACS Development: export_vars & export_entire_form_as_url_vars
I think I have found an obscure bug in the aforementioned procs. It is very easy to reproduce for export_vars, but also the other proc is affected.
Try this code
set test --
set -- whatever
It will complain about wrong args in ns_urlencode. This is because the "--" has special meaning for ns_urlencode, separating flags from arguments.
If you replace all ns_urlencode calls into the procs from
ns_urlencode -- $var
things go ok.
NOTE: current export_vars encodes url path AND variables using the same ns_urlencode, which is wrong AFAIK.
export_entire_form_as_url_vars encodes variables using ad_urlencode_query instead, which should be the right way to go. I think we should fix this, as export_vars should be the preferred interface for exporting.
If someone confirms this is a bug I can take care of the fix.
All the best
NaviServer makes the distinction, but it might spit out the message that you saw. In order to keep aolserver compatibility, I've defined a while ago [ad_urlencode_path ...] and [ad_urlencode_query ...], which is defined also for aolserver...
all the best