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 committed by Knah Tsaeb
parent f2391a5793
commit 3e361b0394

View file

@ -1536,6 +1536,7 @@ function renderPage()
if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">self.close();</script>'; exit; } if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script language="JavaScript">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;
} }