X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=c4c0d15ada79b7420dca028f149d50b043c9178b;hb=4df7ef0b3d703ac3380404749e9c0bc801c3e0b8;hp=84282b8dc6c6ecc41dd67cae0eae0e9c3fdf883a;hpb=72ccf0723c419618b2b6a822721628a9188bcbf0;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 84282b8d..c4c0d15a 100644 --- a/index.php +++ b/index.php @@ -1314,18 +1314,19 @@ function renderPage($conf, $pluginManager) } // -------- User clicked the "Delete" button when editing a link: Delete link from database. - if (isset($_POST['delete_link'])) + if ($targetPage == Router::$PAGE_DELETELINK) { - if (!tokenOk($_POST['token'])) die('Wrong token.'); + if (!tokenOk($_GET['token'])) die('Wrong token.'); // We do not need to ask for confirmation: // - confirmation is handled by JavaScript // - we are protected from XSRF by the token. - $linkdate=$_POST['lf_linkdate']; - - $pluginManager->executeHooks('delete_link', $LINKSDB[$linkdate]); + $linkdate = $_GET['delete_link']; + $link = $LINKSDB[$linkdate]; + + $pluginManager->executeHooks('delete_link', $link); unset($LINKSDB[$linkdate]); - $LINKSDB->save('resource.page_cache'); // save to disk + $LINKSDB->save($conf->get('resource.page_cache')); // save to disk // If we are called from the bookmarklet, we must close the popup: if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; }