From 3e361b03948de5f4c9ebc612a99e280a186b0300 Mon Sep 17 00:00:00 2001 From: nodiscc Date: Wed, 4 Mar 2015 19:09:01 +0100 Subject: [PATCH] Redirect to homepage after adding a link via "Add Link" dialog * Fixes https://github.com/shaarli/Shaarli/issues/115 --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 49f4e10..5ec68b2 100644 --- a/index.php +++ b/index.php @@ -1536,6 +1536,7 @@ function renderPage() if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo ''; exit; } $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. + if (strstr($returnurl, "do=addlink")) { $returnurl = '?'; } //if we come from ?do=addlink, set returnurl to homepage instead header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. exit; }