diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 17 |
1 files changed, 3 insertions, 14 deletions
@@ -567,20 +567,8 @@ function renderPage($conf, $pluginManager, $bookmarkService, $history, $sessionM | |||
567 | } | 567 | } |
568 | 568 | ||
569 | if ($targetPage == Router::$PAGE_PINLINK) { | 569 | if ($targetPage == Router::$PAGE_PINLINK) { |
570 | if (! isset($_GET['id']) || !$bookmarkService->exists($_GET['id'])) { | 570 | // This route is no longer supported in legacy mode |
571 | // FIXME! Use a proper error system. | 571 | header('Location: ./'); |
572 | $msg = t('Invalid link ID provided'); | ||
573 | echo '<script>alert("'. $msg .'");document.location=\''. index_url($_SERVER) .'\';</script>'; | ||
574 | exit; | ||
575 | } | ||
576 | if (! $sessionManager->checkToken($_GET['token'])) { | ||
577 | die('Wrong token.'); | ||
578 | } | ||
579 | |||
580 | $link = $bookmarkService->get($_GET['id']); | ||
581 | $link->setSticky(! $link->isSticky()); | ||
582 | $bookmarkService->set($link); | ||
583 | header('Location: '.index_url($_SERVER)); | ||
584 | exit; | 572 | exit; |
585 | } | 573 | } |
586 | 574 | ||
@@ -1121,6 +1109,7 @@ $app->group('', function () { | |||
1121 | $this->post('/admin/shaare', '\Shaarli\Front\Controller\Admin\ManageShaareController:save'); | 1109 | $this->post('/admin/shaare', '\Shaarli\Front\Controller\Admin\ManageShaareController:save'); |
1122 | $this->get('/admin/shaare/delete', '\Shaarli\Front\Controller\Admin\ManageShaareController:deleteBookmark'); | 1110 | $this->get('/admin/shaare/delete', '\Shaarli\Front\Controller\Admin\ManageShaareController:deleteBookmark'); |
1123 | $this->get('/admin/shaare/visibility', '\Shaarli\Front\Controller\Admin\ManageShaareController:changeVisibility'); | 1111 | $this->get('/admin/shaare/visibility', '\Shaarli\Front\Controller\Admin\ManageShaareController:changeVisibility'); |
1112 | $this->get('/admin/shaare/{id:[0-9]+}/pin', '\Shaarli\Front\Controller\Admin\ManageShaareController:pinBookmark'); | ||
1124 | 1113 | ||
1125 | $this->get('/links-per-page', '\Shaarli\Front\Controller\Admin\SessionFilterController:linksPerPage'); | 1114 | $this->get('/links-per-page', '\Shaarli\Front\Controller\Admin\SessionFilterController:linksPerPage'); |
1126 | $this->get('/visibility/{visibility}', '\Shaarli\Front\Controller\Admin\SessionFilterController:visibility'); | 1115 | $this->get('/visibility/{visibility}', '\Shaarli\Front\Controller\Admin\SessionFilterController:visibility'); |