aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/index.php b/index.php
index 2815f02e..cd83600b 100644
--- a/index.php
+++ b/index.php
@@ -1470,19 +1470,20 @@ function renderPage()
1470 // -------- User wants to rename a tag or delete it 1470 // -------- User wants to rename a tag or delete it
1471 if ($targetPage == Router::$PAGE_CHANGETAG) 1471 if ($targetPage == Router::$PAGE_CHANGETAG)
1472 { 1472 {
1473 if (empty($_POST['fromtag'])) 1473 if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
1474 { 1474 $PAGE->assign('linkcount', count($LINKSDB));
1475 $PAGE->assign('linkcount',count($LINKSDB)); 1475 $PAGE->assign('token', getToken());
1476 $PAGE->assign('token',getToken());
1477 $PAGE->assign('tags', $LINKSDB->allTags()); 1476 $PAGE->assign('tags', $LINKSDB->allTags());
1478 $PAGE->renderPage('changetag'); 1477 $PAGE->renderPage('changetag');
1479 exit; 1478 exit;
1480 } 1479 }
1481 if (!tokenOk($_POST['token'])) die('Wrong token.'); 1480
1481 if (!tokenOk($_POST['token'])) {
1482 die('Wrong token.');
1483 }
1482 1484
1483 // Delete a tag: 1485 // Delete a tag:
1484 if (!empty($_POST['deletetag']) && !empty($_POST['fromtag'])) 1486 if (isset($_POST['deletetag']) && !empty($_POST['fromtag'])) {
1485 {
1486 $needle=trim($_POST['fromtag']); 1487 $needle=trim($_POST['fromtag']);
1487 // True for case-sensitive tag search. 1488 // True for case-sensitive tag search.
1488 $linksToAlter = $LINKSDB->filter(LinkFilter::$FILTER_TAG, $needle, true); 1489 $linksToAlter = $LINKSDB->filter(LinkFilter::$FILTER_TAG, $needle, true);
@@ -1499,8 +1500,7 @@ function renderPage()
1499 } 1500 }
1500 1501
1501 // Rename a tag: 1502 // Rename a tag:
1502 if (!empty($_POST['renametag']) && !empty($_POST['fromtag']) && !empty($_POST['totag'])) 1503 if (isset($_POST['renametag']) && !empty($_POST['fromtag']) && !empty($_POST['totag'])) {
1503 {
1504 $needle=trim($_POST['fromtag']); 1504 $needle=trim($_POST['fromtag']);
1505 // True for case-sensitive tag search. 1505 // True for case-sensitive tag search.
1506 $linksToAlter = $LINKSDB->filter(LinkFilter::$FILTER_TAG, $needle, true); 1506 $linksToAlter = $LINKSDB->filter(LinkFilter::$FILTER_TAG, $needle, true);