Redirect to homepage after adding a link via "Add Link" dialog

* Fixes https://github.com/shaarli/Shaarli/issues/115
This commit is contained in:
nodiscc 2015-03-04 19:09:01 +01:00
parent 473f37a2ee
commit 35c2c4db5b

View file

@ -1560,6 +1560,7 @@ function renderPage()
if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; }
$returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' );
$returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. $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. header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on.
exit; exit;
} }