Fixes "PHP Notice: Undefined variable: item in src/Model/Post/Media.php on line 561"
This commit is contained in:
parent
75e450bc15
commit
6f7e063b34
1 changed files with 3 additions and 1 deletions
|
@ -538,6 +538,8 @@ class Media
|
||||||
}
|
}
|
||||||
$body = $item['body'];
|
$body = $item['body'];
|
||||||
}
|
}
|
||||||
|
$original_body = $body;
|
||||||
|
|
||||||
$body = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", '', $body);
|
$body = preg_replace("/\s*\[attachment .*?\].*?\[\/attachment\]\s*/ism", '', $body);
|
||||||
|
|
||||||
foreach (self::getByURIId($uriid, [self::IMAGE, self::AUDIO, self::VIDEO]) as $media) {
|
foreach (self::getByURIId($uriid, [self::IMAGE, self::AUDIO, self::VIDEO]) as $media) {
|
||||||
|
@ -558,7 +560,7 @@ class Media
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $item['body'], $match)) {
|
if (preg_match("/.*(\[attachment.*?\].*?\[\/attachment\]).*/ism", $original_body, $match)) {
|
||||||
$body .= "\n" . $match[1];
|
$body .= "\n" . $match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue