Skip to content

Commit

Permalink
Redirect to homepage after adding a link via "Add Link" dialog
Browse files Browse the repository at this point in the history
 * Fixes #115
  • Loading branch information
nodiscc committed Mar 5, 2015
1 parent 473f37a commit 35c2c4d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,7 @@ function renderPage()
if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; 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;
}
Expand Down

1 comment on commit 35c2c4d

@mro
Copy link

@mro mro commented on 35c2c4d Sep 18, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just injecting returnurl from the beginning? See the issue at #308 (comment)

Please sign in to comment.