From: nodiscc Date: Wed, 4 Mar 2015 18:09:01 +0000 (+0100) Subject: Redirect to homepage after adding a link via "Add Link" dialog X-Git-Tag: v0.0.44beta~14^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=35c2c4db5b5179e571023ab7fa7d3ecc03c85391;p=github%2Fshaarli%2FShaarli.git Redirect to homepage after adding a link via "Add Link" dialog * Fixes https://github.com/shaarli/Shaarli/issues/115 --- diff --git a/index.php b/index.php index a8326a2b..cda918df 100644 --- a/index.php +++ b/index.php @@ -1560,6 +1560,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; }