added redact function to Attachments.php