event.preventDefault();
const block = findParent(event.target, 'div', { class: 'tag-list-item' });
const tag = block.getAttribute('data-tag');
- const refreshedToken = document.getElementById('token');
+ const refreshedToken = document.getElementById('token').value;
if (confirm(`Are you sure you want to delete the tag "${tag}"?`)) {
const xhr = new XMLHttpRequest();
die(t('Wrong token.'));
}
- $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), escape($_POST['totag']));
+ $toTag = isset($_POST['totag']) ? escape($_POST['totag']) : null;
+ $alteredLinks = $LINKSDB->renameTag(escape($_POST['fromtag']), $toTag);
$LINKSDB->save($conf->get('resource.page_cache'));
foreach ($alteredLinks as $link) {
$history->updateLink($link);