X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=0ef3363354e54f69a958092fafaf5d7ba619855f;hb=10a7b5cee96a742fbe86edbea977f3c55c92e9aa;hp=9c1e4999ed68ef717142b66b4511403918ed8eb6;hpb=5d9bc40d7e48b8ac4829f9101f85b849d9199fa3;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 9c1e4999..0ef33633 100644 --- a/index.php +++ b/index.php @@ -1084,7 +1084,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager, 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); @@ -1236,10 +1237,10 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager, $id = (int) escape($id); $link = $LINKSDB[$id]; $pluginManager->executeHooks('delete_link', $link); + $history->deleteLink($link); unset($LINKSDB[$id]); } $LINKSDB->save($conf->get('resource.page_cache')); // save to disk - $history->deleteLink($link); // If we are called from the bookmarklet, we must close the popup: if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; }