Update of /cvsroot/mahogany/M/src/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25662/src/modules
Modified Files:
Filters.cpp
Log Message:
check name and not only filename in executable attachment test
Index: Filters.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/modules/Filters.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -b -u -2 -r1.191 -r1.192
--- Filters.cpp 15 May 2004 16:42:11 -0000 1.191
+++ Filters.cpp 15 May 2004 16:59:52 -0000 1.192
@@ -2084,26 +2084,36 @@
}
-// check if we have any executable attachments in this message
-static bool CheckForExeAttach(const MimePart *part)
+// CheckForExeAttach() helper
+static bool IsExeFilename(const String& filename)
{
- while ( part )
- {
- if ( CheckForExeAttach(part->GetNested()) )
- return true;
+ if ( filename.empty() )
+ return false;
- String filename = part->GetParam(_T("filename")).Lower();
- if ( !filename.empty() )
- {
String ext;
wxSplitPath(filename, NULL, NULL, &ext);
- wxSortedArrayString extsExe;
+
+ // FIXME: make configurable
+ static wxSortedArrayString extsExe;
+ if ( extsExe.IsEmpty() )
+ {
extsExe.Add(_T("scr"));
extsExe.Add(_T("pif"));
extsExe.Add(_T("hta"));
- if ( extsExe.Index(ext) != wxNOT_FOUND )
+ }
+
+ return extsExe.Index(ext.Lower()) != wxNOT_FOUND;
+}
+
+// check if we have any executable attachments in this message
+static bool CheckForExeAttach(const MimePart *part)
+{
+ while ( part )
{
+ if ( CheckForExeAttach(part->GetNested()) )
+ return true;
+
+ if ( IsExeFilename(part->GetParam(_T("filename"))) ||
+ IsExeFilename(part->GetParam(_T("name"))) )
return true;
- }
- }
part = part->GetNext();
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates