From d01c234235411bafb97661d335fcb6ea1e67ffbc Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 4 Nov 2015 19:53:59 +0100 Subject: Fixes #356 * adding a link should return added link's hash * allow redirection relative urls in generateLocation --- index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index c430a200..3be6be9e 100755 --- a/index.php +++ b/index.php @@ -1354,10 +1354,14 @@ function renderPage() pubsubhub(); // If we are called from the bookmarklet, we must close the popup: - if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo ''; exit; } - $returnurl = ( !empty($_POST['returnurl']) ? escape($_POST['returnurl']) : '?' ); - $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. + if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { + echo ''; + exit; + } + + $returnurl = !empty($_POST['returnurl']) ? escape($_POST['returnurl']): '?'; $location = generateLocation($returnurl, $_SERVER['HTTP_HOST'], array('addlink', 'post', 'edit_link')); + $location .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. header('Location: '. $location); // After saving the link, redirect to the page the user was on. exit; } -- cgit v1.2.3