Skip to content

Commit 1f6c8a8

Browse files
authored
Merge branch 'smf21' into 215release
2 parents 36c7d12 + ad6ae17 commit 1f6c8a8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

sd_source/SimpleDesk-AjaxHandler.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,7 @@ function shd_ajax_canned()
500500
censorText($message);
501501
$message = preg_replace('~<br ?/?' . '>~i', "\n", $row['body']);
502502

503-
$message = strtr($message, array('&nbsp;' => '&#160;', '<' => '&lt;', '>' => '&gt;'));
504-
return array('success' => true, 'message' => $message);
503+
return array('success' => true, 'message' => un_htmlspecialchars($message));
505504
}
506505

507506
/**

sd_source/SimpleDesk-Post.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1738,6 +1738,11 @@ function shd_check_attachments()
17381738
continue;
17391739
}
17401740

1741+
if (!file_exists($current_attach_dir . '/' . $attachID)) {
1742+
unset($_SESSION['temp_attachments'][$attachID]);
1743+
continue;
1744+
}
1745+
17411746
$quantity++;
17421747
$total_size += filesize($current_attach_dir . '/' . $attachID);
17431748

@@ -2003,7 +2008,12 @@ function shd_handle_attachments()
20032008
continue;
20042009
}
20052010

2006-
$_FILES['attachment' . $attachID]['tmp_name'] = $attachID;
2011+
if (!file_exists($current_attach_dir . '/' . $attachID)) {
2012+
unset($_SESSION['temp_attachments'][$attachID]);
2013+
continue;
2014+
}
2015+
2016+
$_FILES['attachment' . $attachID]['tmp_name'] = $current_attach_dir . '/' . $attachID;
20072017
$_FILES['attachment' . $attachID]['name'] = $name;
20082018
$_FILES['attachment' . $attachID]['size'] = filesize($current_attach_dir . '/' . $attachID);
20092019
list ($_FILES['attachment' . $attachID]['width'], $_FILES['attachment' . $attachID]['height']) = @getimagesize($current_attach_dir . '/' . $attachID);

0 commit comments

Comments
 (0)