Index: openacs-4/packages/file-storage/www/download-archive/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/download-archive/index.vuh,v diff -u -N -r1.5.8.3 -r1.5.8.4 --- openacs-4/packages/file-storage/www/download-archive/index.vuh 28 Nov 2014 15:14:48 -0000 1.5.8.3 +++ openacs-4/packages/file-storage/www/download-archive/index.vuh 10 Apr 2015 09:52:06 -0000 1.5.8.4 @@ -1,3 +1,4 @@ +# -*- Tcl -*- # file-storage/www/download-archive/index.vuh ad_page_contract { @@ -10,7 +11,7 @@ {object_id:naturalnum,optional} } -if {([info exists object_id] && $object_id ne "")} { +if {[info exists object_id] && $object_id ne ""} { set download_name [fs::get_file_system_safe_object_name -object_id $object_id] set ext [fs::get_archive_extension] if {$ext ne ""} { @@ -22,8 +23,14 @@ } # convenient way to get the values out of a list -foreach {object_id download_name} [split [ad_conn path_info] /] {break} +lassign [split [ad_conn path_info] /] object_id download_name +# The assignment above might not set the object_id, so set it to a +# value in that case such it will fail in the object_p test below. +if {![info exists object_id]} { + set object_id "" +} + if {![fs::object_p -object_id $object_id]} { ad_return_complaint 1 "Object \#$object_id is not a file storage object." ad_script_abort