diff options
author | Arthur <arthur@hoa.ro> | 2015-11-07 16:51:50 +0100 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2015-11-07 16:51:50 +0100 |
commit | 70df947af60afb05529024bb2d3825eaf6cc7950 (patch) | |
tree | 0cade3729406e61435e63b7b27e4957f8a2abd47 /index.php | |
parent | 38bedfbbcdd2a40e9f04f5753e0fd6f4fd513c21 (diff) | |
parent | d01c234235411bafb97661d335fcb6ea1e67ffbc (diff) | |
download | Shaarli-70df947af60afb05529024bb2d3825eaf6cc7950.tar.gz Shaarli-70df947af60afb05529024bb2d3825eaf6cc7950.tar.zst Shaarli-70df947af60afb05529024bb2d3825eaf6cc7950.zip |
Merge pull request #368 from ArthurHoaro/returnurl-again
Fixes #356 - adding a link should return added link's hash
Diffstat (limited to 'index.php')
-rwxr-xr-x | index.php | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1354,10 +1354,14 @@ function renderPage() | |||
1354 | pubsubhub(); | 1354 | pubsubhub(); |
1355 | 1355 | ||
1356 | // If we are called from the bookmarklet, we must close the popup: | 1356 | // If we are called from the bookmarklet, we must close the popup: |
1357 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { echo '<script>self.close();</script>'; exit; } | 1357 | if (isset($_GET['source']) && ($_GET['source']=='bookmarklet' || $_GET['source']=='firefoxsocialapi')) { |
1358 | $returnurl = ( !empty($_POST['returnurl']) ? escape($_POST['returnurl']) : '?' ); | 1358 | echo '<script>self.close();</script>'; |
1359 | $returnurl .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. | 1359 | exit; |
1360 | } | ||
1361 | |||
1362 | $returnurl = !empty($_POST['returnurl']) ? escape($_POST['returnurl']): '?'; | ||
1360 | $location = generateLocation($returnurl, $_SERVER['HTTP_HOST'], array('addlink', 'post', 'edit_link')); | 1363 | $location = generateLocation($returnurl, $_SERVER['HTTP_HOST'], array('addlink', 'post', 'edit_link')); |
1364 | $location .= '#'.smallHash($_POST['lf_linkdate']); // Scroll to the link which has been edited. | ||
1361 | header('Location: '. $location); // After saving the link, redirect to the page the user was on. | 1365 | header('Location: '. $location); // After saving the link, redirect to the page the user was on. |
1362 | exit; | 1366 | exit; |
1363 | } | 1367 | } |