Skip to content

Commit 35a23be

Browse files
author
Jared Hancock
committed
oops: Fixup image stripping (again)
1 parent b705110 commit 35a23be

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/class.file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ function getName() {
9494
}
9595

9696
function getKey() {
97-
return $this->ht['key'];
97+
return strtolower($this->ht['key']);
9898
}
9999

100100
function getSignature() {

include/class.thread.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,7 @@ function create($vars) {
886886
// ->convert() because the strippedImages list will not propagate to
887887
// the newly converted thread body
888888
if ($vars['attachments']) {
889-
foreach ($body->getStrippedImages() as $cid) {
889+
foreach ($vars['body']->getStrippedImages() as $cid) {
890890
foreach ($vars['attachments'] as $i=>$a) {
891891
if (@$a['cid'] && $a['cid'] == $cid) {
892892
// Inline referenced attachment was stripped
@@ -1178,17 +1178,17 @@ function stripQuotedReply($tag) {
11781178

11791179
// Capture a list of inline images
11801180
$images_before = $images_after = array();
1181-
preg_match_all('/src="cid:([\w_-]+)"/', $this->body, $images_before,
1182-
PREG_SET_ORDER);
1181+
preg_match_all('/src="cid:([\w_-]+)(?:@|")/', $this->body, $images_before,
1182+
PREG_PATTERN_ORDER);
11831183

11841184
// Strip the quoted part of the body
11851185
if ((list($msg) = explode($tag, $this->body, 2)) && trim($msg)) {
11861186
$this->body = $msg;
11871187

11881188
// Capture a list of dropped inline images
11891189
if ($images_before) {
1190-
preg_match_all('/src="cid:([\w_-]+)"/', $this->body,
1191-
$images_after, PREG_SET_ORDER);
1190+
preg_match_all('/src="cid:([\w_-]+)(?:@|")/', $this->body,
1191+
$images_after, PREG_PATTERN_ORDER);
11921192
$this->stripped_images = array_diff($images_before[1],
11931193
$images_after[1]);
11941194
}

0 commit comments

Comments
 (0)