diff options
author | nodiscc <nodiscc@gmail.com> | 2015-03-04 19:09:01 +0100 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2015-03-05 13:43:53 +0100 |
commit | 35c2c4db5b5179e571023ab7fa7d3ecc03c85391 (patch) | |
tree | 51e686b4af48906b2cf2e0816e4b415d0e1d92cb /index.php | |
parent | 473f37a2eea01af869f87c843217d216994346e3 (diff) | |
download | Shaarli-35c2c4db5b5179e571023ab7fa7d3ecc03c85391.tar.gz Shaarli-35c2c4db5b5179e571023ab7fa7d3ecc03c85391.tar.zst Shaarli-35c2c4db5b5179e571023ab7fa7d3ecc03c85391.zip |
Redirect to homepage after adding a link via "Add Link" dialog
* Fixes https://github.com/shaarli/Shaarli/issues/115
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1560,6 +1560,7 @@ function renderPage() | |||
1560 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } | 1560 | if (isset($_GET['source']) && $_GET['source']=='bookmarklet') { echo '<script>self.close();</script>'; exit; } |
1561 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); | 1561 | $returnurl = ( isset($_POST['returnurl']) ? $_POST['returnurl'] : '?' ); |
1562 | $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. | 1562 | $returnurl .= '#'.smallHash($linkdate); // Scroll to the link which has been edited. |
1563 | if (strstr($returnurl, "do=addlink")) { $returnurl = '?'; } //if we come from ?do=addlink, set returnurl to homepage instead | ||
1563 | header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. | 1564 | header('Location: '.$returnurl); // After saving the link, redirect to the page the user was on. |
1564 | exit; | 1565 | exit; |
1565 | } | 1566 | } |