Skip to content
Snippets Groups Projects
Commit 5a44b5a2 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #668 from greezybacon/issue/api-attachment


Fix incorrect file attachment if filetype is rejected
Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 1be5d247 27996836
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ class TicketApiController extends ApiController {
if($data['attachments'] && is_array($data['attachments'])) {
foreach($data['attachments'] as &$attachment) {
if(!$ost->isFileTypeAllowed($attachment))
$data['error'] = 'Invalid file type (ext) for '.Format::htmlchars($attachment['name']);
$attachment['error'] = 'Invalid file type (ext) for '.Format::htmlchars($attachment['name']);
elseif ($attachment['encoding'] && !strcasecmp($attachment['encoding'], 'base64')) {
if(!($attachment['data'] = base64_decode($attachment['data'], true)))
$attachment['error'] = sprintf('%s: Poorly encoded base64 data', Format::htmlchars($attachment['name']));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment