X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FItemsource.php;h=d781db3ac5d207b54bdfb4f3a7050e17587acdfa;hb=774d04cd2fbdfaa36beb74b8a38b025c96184ff9;hp=e0d3bd01613d66115ded2f24a7c82bf1b741b1fc;hpb=91facd2d0a2869e2c26a5943d8afe1849d3891f8;p=friendica.git diff --git a/src/Module/Itemsource.php b/src/Module/Itemsource.php index e0d3bd0161..d781db3ac5 100644 --- a/src/Module/Itemsource.php +++ b/src/Module/Itemsource.php @@ -17,22 +17,37 @@ class Itemsource extends \Friendica\BaseModule return; } + $a = self::getApp(); + + // @TODO: Replace with parameter from router + if (!empty($a->argv[1])) { + $guid = $a->argv[1]; + } + + $guid = defaults($_REQUEST['guid'], $guid); + $source = ''; $item_uri = ''; - if (!empty($_REQUEST['guid'])) { - $item = Model\Item::selectFirst([], ['guid' => $_REQUEST['guid']]); + $item_id = ''; + $terms = []; + if (!empty($guid)) { + $item = Model\Item::selectFirst(['id', 'guid', 'uri'], ['guid' => $guid]); $conversation = Model\Conversation::getByItemUri($item['uri']); + $item_id = $item['id']; $item_uri = $item['uri']; - $source = htmlspecialchars($conversation['source']); + $source = $conversation['source']; + $terms = Model\Term::tagArrayFromItemId($item['id'], [Model\Term::HASHTAG, Model\Term::MENTION, Model\Term::IMPLICIT_MENTION]); } - $tpl = get_markup_template('debug/itemsource.tpl'); + $tpl = Renderer::getMarkupTemplate('debug/itemsource.tpl'); $o = Renderer::replaceMacros($tpl, [ - '$guid' => ['guid', L10n::t('Item Guid'), htmlentities(defaults($_REQUEST, 'guid', '')), ''], + '$guid' => ['guid', L10n::t('Item Guid'), $guid, ''], '$source' => $source, - '$item_uri' => $item_uri + '$item_uri' => $item_uri, + '$item_id' => $item_id, + '$terms' => $terms, ]); return $o;