Index: openacs-4/packages/search/tcl/search-convert-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/tcl/search-convert-procs.tcl,v diff -u -r1.5.2.2 -r1.5.2.3 --- openacs-4/packages/search/tcl/search-convert-procs.tcl 4 Feb 2022 11:07:11 -0000 1.5.2.2 +++ openacs-4/packages/search/tcl/search-convert-procs.tcl 1 Mar 2022 09:18:44 -0000 1.5.2.3 @@ -46,6 +46,11 @@ set convert_command {catppt $filename >$tmp_filename} } application/pdf { + if {![util::file_content_check -type pdf -file $filename]} { + ns_log warning "search: $filename ($mime_type) is not a pdf file; skip indexing" + file delete -- $tmp_filename + return "" + } set convert_command {pdftotext $filename $tmp_filename} } application/vnd.oasis.opendocument.text - @@ -56,6 +61,11 @@ application/vnd.oasis.opendocument.presentation-template - application/vnd.oasis.opendocument.spreadsheet - application/vnd.oasis.opendocument.spreadsheet-template { + if {![util::file_content_check -type zip -file $filename]} { + ns_log warning "search: $filename ($mime_type) is not a zip file; skip indexing" + file delete -- $tmp_filename + return "" + } set convert_command {unzip -p $filename content.xml >$tmp_filename} } text/html {