mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-07 15:54:26 +02:00
Fix redirect for photo remove tag page and only show the link if tags exist.
This commit is contained in:
parent
2475095da0
commit
58ac3fbb29
2 changed files with 4 additions and 4 deletions
|
@ -1022,7 +1022,7 @@ function photos_content()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
|
$tags = ['title' => DI::l10n()->t('Tags: '), 'tags' => $tag_arr];
|
||||||
if ($cmd === 'edit') {
|
if ($cmd === 'edit' && !empty($tag_arr)) {
|
||||||
$tags['removeanyurl'] = 'post/' . $link_item['id'] . '/tag/remove?return=' . urlencode(DI::args()->getCommand());
|
$tags['removeanyurl'] = 'post/' . $link_item['id'] . '/tag/remove?return=' . urlencode(DI::args()->getCommand());
|
||||||
$tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
|
$tags['removetitle'] = DI::l10n()->t('[Select tags to remove]');
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Remove extends \Friendica\BaseModule
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
{
|
{
|
||||||
$returnUrl = hex2bin($request['return'] ?? '');
|
$returnUrl = $request['return'] ?? '';
|
||||||
|
|
||||||
if (!$this->session->getLocalUserId()) {
|
if (!$this->session->getLocalUserId()) {
|
||||||
$this->baseUrl->redirect($returnUrl);
|
$this->baseUrl->redirect($returnUrl);
|
||||||
|
@ -80,7 +80,7 @@ class Remove extends \Friendica\BaseModule
|
||||||
if ($tag_text === '') {
|
if ($tag_text === '') {
|
||||||
$this->baseUrl->redirect($returnUrl);
|
$this->baseUrl->redirect($returnUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags = explode(',', $tag_text);
|
$tags = explode(',', $tag_text);
|
||||||
|
|
||||||
$tag_checkboxes = array_map(function ($tag_text) {
|
$tag_checkboxes = array_map(function ($tag_text) {
|
||||||
|
@ -97,7 +97,7 @@ class Remove extends \Friendica\BaseModule
|
||||||
],
|
],
|
||||||
|
|
||||||
'$item_id' => $item_id,
|
'$item_id' => $item_id,
|
||||||
'$return' => $returnUrl,
|
'$return' => urlencode($returnUrl),
|
||||||
'$tag_checkboxes' => $tag_checkboxes,
|
'$tag_checkboxes' => $tag_checkboxes,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue