From 3c8216e38582d05f746f2a21a63495fa63a40764 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 5 Apr 2020 17:25:36 +0000 Subject: [PATCH] Fix notice about an unknown variable --- include/conversation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index ad2dd55de..0ae8dd14a 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -148,6 +148,8 @@ function localize_item(&$item) if (!empty($item['verb'])) { $activity = DI::activity(); + $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">"; + if (stristr($item['verb'], Activity::POKE)) { $verb = urldecode(substr($item['verb'], strpos($item['verb'],'#') + 1)); if (!$verb) { @@ -160,8 +162,6 @@ function localize_item(&$item) $Aname = $item['author-name']; $Alink = $item['author-link']; - $xmlhead = "<" . "?xml version='1.0' encoding='UTF-8' ?" . ">"; - $obj = XML::parseString($xmlhead . $item['object']); $Bname = $obj->title; @@ -237,7 +237,7 @@ function localize_item(&$item) } $plink = '[url=' . $obj['plink'] . ']' . $post_type . '[/url]'; - $parsedobj = XML::parseString($xmlhead.$item['object']); + $parsedobj = XML::parseString($xmlhead . $item['object']); $tag = sprintf('#[url=%s]%s[/url]', $parsedobj->id, $parsedobj->content); $item['body'] = DI::l10n()->t('%1$s tagged %2$s\'s %3$s with %4$s', $author, $objauthor, $plink, $tag);