diff --git a/attachments_component/site/helper.php b/attachments_component/site/helper.php index 59eb27d6..7d9a2782 100644 --- a/attachments_component/site/helper.php +++ b/attachments_component/site/helper.php @@ -432,10 +432,7 @@ public static function upload_file(&$attachment, &$parent, $attachment_id=false, } // Get the new filename - // (Note: The following replacement is necessary to allow - // single quotes in filenames to work correctly.) - // Trim of any trailing period (to avoid exploits) - $filename = rtrim(JString::str_ireplace("\'", "'", $_FILES['upload']['name']), '.'); + $filename = JFile::makeSafe(strtolower($_FILES['upload']['name'])); $ftype = $_FILES['upload']['type']; // Check the file size