Merge pull request #9531 from annando/fatal
Check for empty body to prevent a fatal error
This commit is contained in:
commit
490ce976c1
1 changed files with 4 additions and 1 deletions
|
@ -2479,12 +2479,15 @@ class Item
|
||||||
*/
|
*/
|
||||||
private static function getLanguage(array $item)
|
private static function getLanguage(array $item)
|
||||||
{
|
{
|
||||||
if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT])) {
|
if (!in_array($item['gravity'], [GRAVITY_PARENT, GRAVITY_COMMENT]) || empty($item['body'])) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert attachments to links
|
// Convert attachments to links
|
||||||
$naked_body = BBCode::removeAttachment($item['body']);
|
$naked_body = BBCode::removeAttachment($item['body']);
|
||||||
|
if (empty($naked_body)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
// Remove links and pictures
|
// Remove links and pictures
|
||||||
$naked_body = BBCode::removeLinks($naked_body);
|
$naked_body = BBCode::removeLinks($naked_body);
|
||||||
|
|
Loading…
Reference in a new issue