Index: openacs-4/packages/forums/www/message-post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post.tcl,v diff -u -r1.42 -r1.43 --- openacs-4/packages/forums/www/message-post.tcl 28 Apr 2009 16:38:59 -0000 1.42 +++ openacs-4/packages/forums/www/message-post.tcl 27 Oct 2014 16:41:38 -0000 1.43 @@ -11,17 +11,27 @@ {parent_id ""} } -validate { forum_id_or_parent_id { - if {$forum_id eq "" && $parent_id eq ""} { - ad_complain [_ forums.lt_You_either_have_to] - } + if {$forum_id eq "" && $parent_id eq ""} { + ad_complain [_ forums.lt_You_either_have_to] + } + # + # GN: why can't we use {forum_id:integer ""} above? if we do so, the + # forum_id is not set! + # + if {$forum_id ne "" && ![string is integer $forum_id]} { + ad_complain [_ acs_templating.Invalid_integer] + } + if {$parent_id ne "" && ![string is integer $parent_id]} { + ad_complain [_ acs-templating.Invalid_integer] + } } } -if { ![empty_string_p [ns_queryget formbutton:post]] } { +if { [ns_queryget formbutton:post] ne "" } { set action post -} elseif { ![empty_string_p [ns_queryget formbutton:preview]] } { +} elseif { [ns_queryget formbutton:preview] ne "" } { set action preview -} elseif { ![empty_string_p [ns_queryget formbutton:edit]] } { +} elseif { [ns_queryget formbutton:edit] ne "" } { set action edit } else { set action ""