I found the file extension checking for attachments a bit flaky, it didn't like newlines too well, and some folks may like to enter a line per extension.
So here's my suggested improvement. Hopefully it's more resilient than the existing one...
function canUploadFileType($filename) {
$ext = preg_replace("/.*\.(.{3,4})$/", "$1", $filename);
if ($ext && $this->config) {
$ext = strtolower($ext);
$allowed = array();
$tok = strtok($this->config, " ,\n\t");
while ($tok) {
$tok = strtolower(trim($tok));
if ($tok) {
$allowed = $tok;
}
$tok = strtok(" ,\n\t");
}
print_r($allowed);
return in_array(".$ext", $allowed);
}
return FALSE;
}