]> git.mxchange.org Git - friendica.git/blobdiff - mod/photos.php
Unused use removed
[friendica.git] / mod / photos.php
index 56b722e8f701fc87293e102b8a44d9de4469d1cf..ccf0525cb00040c36ae74def0f9fd8f6d080db2c 100644 (file)
@@ -30,7 +30,6 @@ use Friendica\Core\Addon;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -1251,15 +1250,17 @@ function photos_content(App $a)
                if (!empty($link_item['id'])) {
                        // parse tags and add links
                        $tag_arr = [];
-                       foreach (Tag::getByURIId($link_item['uri-id']) as $tag) {
-                               $tag_arr[] = [
-                                       'name' => $tag['name'],
-                                       'removeurl' => '/tagrm/' . $link_item['id'] . '/' . bin2hex($tag['name'])
-                               ];
+                       foreach (explode(',', Tag::getCSVByURIId($link_item['uri-id'])) as $tag_name) {
+                               if ($tag_name) {
+                                       $tag_arr[] = [
+                                               'name'      => BBCode::toPlaintext($tag_name),
+                                               'removeurl' => 'post/' . $link_item['id'] . '/tag/remove/' . bin2hex($tag_name) . '?return=' . urlencode(DI::args()->getCommand()),
+                                       ];
+                               }
                        }
                        $tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
                        if ($cmd === 'edit') {
-                               $tags['removeanyurl'] = 'tagrm/' . $link_item['id'];
+                               $tags['removeanyurl'] = 'post/' . $link_item['id'] . '/tag/remove?return=' . urlencode(DI::args()->getCommand());
                                $tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
                        }
                }