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

White-list canned attachments

Add canned attachments to allowed files list when a canned response is used.
parent 82aa2355
No related branches found
No related tags found
No related merge requests found
......@@ -145,6 +145,10 @@ extends VerySimpleModel {
if (!$html) {
$resp['response'] = Format::html2text($resp['response'], 90);
}
foreach ($resp['files'] as $f)
$_SESSION[':cannedFiles'][$f['file_id']] = 1;
return Format::json_encode($resp);
break;
case 'html':
......
......@@ -3717,6 +3717,10 @@ class FileUploadWidget extends Widget {
if (isset($_SESSION[':uploadedFiles']))
$allowed += $_SESSION[':uploadedFiles'];
// Canned attachments initiated by this session
if (isset($_SESSION[':cannedFiles']))
$allowed += $_SESSION[':cannedFiles'];
// Parse the files and make sure it's allowed.
foreach ($files as $info) {
@list($id, $name) = explode(',', $info, 2);
......
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