From b6cd18fcad5339f74e4af4a0f918aa8746fdf2ae Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 13 May 2020 22:38:59 -0400 Subject: [PATCH] [ljpost] Remove references to obsolete virtual field item.tag --- ljpost/ljpost.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php index 382832c5..5120612d 100644 --- a/ljpost/ljpost.php +++ b/ljpost/ljpost.php @@ -12,6 +12,7 @@ use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\DI; +use Friendica\Model\Tag; use Friendica\Util\DateTimeFormat; use Friendica\Util\Network; use Friendica\Util\XML; @@ -188,7 +189,7 @@ function ljpost_send(&$a,&$b) { $title = XML::escape($b['title']); $post = BBCode::convert($b['body']); $post = XML::escape($post); - $tags = ljpost_get_tags($b['tag']); + $tags = Tag::getCSVByURIId($b['uri-id'], [Tag::HASHTAG]); $date = DateTimeFormat::convert($b['created'], $tz); $year = intval(substr($date,0,4)); @@ -245,10 +246,3 @@ EOT; Logger::log('posted to livejournal: ' . ($x) ? $x : '', Logger::DEBUG); } } - -function ljpost_get_tags($post) -{ - preg_match_all("/\]([^\[#]+)\[/",$post,$matches); - $tags = implode(', ',$matches[1]); - return $tags; -} -- 2.39.5