Index: openacs-4/packages/general-comments/www/comment-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add-2.tcl,v diff -u -r1.8.2.1 -r1.8.2.2 --- openacs-4/packages/general-comments/www/comment-add-2.tcl 16 Mar 2022 10:30:26 -0000 1.8.2.1 +++ openacs-4/packages/general-comments/www/comment-add-2.tcl 26 Apr 2022 19:25:17 -0000 1.8.2.2 @@ -12,7 +12,7 @@ { object_name "[acs_object_name $object_id]" } title:notnull content:html,notnull - comment_mime_type:notnull + comment_mime_type:notnull,printable { context_id:naturalnum "$object_id" } { category {} } { return_url:localurl {} } @@ -28,7 +28,7 @@ category:onevalue return_url:onevalue } -validate { - comment_mime_type_allowed -requires comment_mime_type:notnull { + comment_mime_type_allowed -requires comment_mime_type:notnull,printable { if {$comment_mime_type ni {"text/plain" "text/html"}} { ad_complain [_ acs-tcl.lt_name_is_not_valid [list name comment_mime_type]] return Index: openacs-4/packages/general-comments/www/comment-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-add-3.tcl,v diff -u -r1.13.2.4 -r1.13.2.5 --- openacs-4/packages/general-comments/www/comment-add-3.tcl 16 Mar 2022 10:47:32 -0000 1.13.2.4 +++ openacs-4/packages/general-comments/www/comment-add-3.tcl 26 Apr 2022 19:25:17 -0000 1.13.2.5 @@ -12,13 +12,13 @@ object_id:naturalnum,notnull title:notnull content:html,notnull - comment_mime_type:notnull + comment_mime_type:notnull,printable { context_id:naturalnum "$object_id" } { category "" } { return_url:localurl "" } { attach_p:boolean "f" } } -validate { - comment_mime_type_allowed -requires comment_mime_type:notnull { + comment_mime_type_allowed -requires comment_mime_type:notnull,printable { if {$comment_mime_type ni {"text/plain" "text/html"}} { ad_complain [_ acs-tcl.lt_name_is_not_valid [list name comment_mime_type]] return Index: openacs-4/packages/general-comments/www/comment-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/www/comment-edit-2.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/general-comments/www/comment-edit-2.tcl 7 Aug 2017 23:48:12 -0000 1.8 +++ openacs-4/packages/general-comments/www/comment-edit-2.tcl 26 Apr 2022 19:25:17 -0000 1.8.2.1 @@ -18,7 +18,7 @@ object_id:naturalnum,notnull title:notnull content:notnull,html - comment_mime_type + comment_mime_type:notnull,printable { return_url:localurl {} } } -properties { page_title:onevalue @@ -27,8 +27,16 @@ title:onevalue content:onevalue target:onevalue +} -validate { + comment_mime_type_allowed -requires comment_mime_type:notnull,printable { + if {$comment_mime_type ni {"text/plain" "text/html"}} { + ad_complain [_ acs-tcl.lt_name_is_not_valid [list name comment_mime_type]] + return + } + } } + # check to see if the user can edit this comment permission::require_permission -object_id $comment_id -privilege write