aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-03-25 20:54:48 +0100
committerGitHub <noreply@github.com>2017-03-25 20:54:48 +0100
commit06cb3300f317856a9bbc243ef54042e6ad5cdc1c (patch)
treedc50ac2bc507387a4f9de61b65259d0120669a21
parentbae74cb292833a4482b3a42b78c020b7f97b7ffd (diff)
parent0b04f7970c92038480ad363e92b00a99971b1820 (diff)
downloadShaarli-06cb3300f317856a9bbc243ef54042e6ad5cdc1c.tar.gz
Shaarli-06cb3300f317856a9bbc243ef54042e6ad5cdc1c.tar.zst
Shaarli-06cb3300f317856a9bbc243ef54042e6ad5cdc1c.zip
Merge pull request #834 from philipp-r/issue-833
Tags parameter for redirects
-rw-r--r--index.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/index.php b/index.php
index 58bb3f44..5c21c2f6 100644
--- a/index.php
+++ b/index.php
@@ -432,7 +432,7 @@ if (isset($_POST['login']))
432 // Optional redirect after login: 432 // Optional redirect after login:
433 if (isset($_GET['post'])) { 433 if (isset($_GET['post'])) {
434 $uri = '?post='. urlencode($_GET['post']); 434 $uri = '?post='. urlencode($_GET['post']);
435 foreach (array('description', 'source', 'title') as $param) { 435 foreach (array('description', 'source', 'title', 'tags') as $param) {
436 if (!empty($_GET[$param])) { 436 if (!empty($_GET[$param])) {
437 $uri .= '&'.$param.'='.urlencode($_GET[$param]); 437 $uri .= '&'.$param.'='.urlencode($_GET[$param]);
438 } 438 }
@@ -461,7 +461,7 @@ if (isset($_POST['login']))
461 $redir = '&username='. $_POST['login']; 461 $redir = '&username='. $_POST['login'];
462 if (isset($_GET['post'])) { 462 if (isset($_GET['post'])) {
463 $redir .= '&post=' . urlencode($_GET['post']); 463 $redir .= '&post=' . urlencode($_GET['post']);
464 foreach (array('description', 'source', 'title') as $param) { 464 foreach (array('description', 'source', 'title', 'tags') as $param) {
465 if (!empty($_GET[$param])) { 465 if (!empty($_GET[$param])) {
466 $redir .= '&' . $param . '=' . urlencode($_GET[$param]); 466 $redir .= '&' . $param . '=' . urlencode($_GET[$param]);
467 } 467 }
@@ -1044,7 +1044,13 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1044 // Show login screen, then redirect to ?post=... 1044 // Show login screen, then redirect to ?post=...
1045 if (isset($_GET['post'])) 1045 if (isset($_GET['post']))
1046 { 1046 {
1047 header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link. 1047 header( // Redirect to login page, then back to post link.
1048 'Location: ?do=login&post='.urlencode($_GET['post']).
1049 (!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').
1050 (!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').
1051 (!empty($_GET['tags'])?'&tags='.urlencode($_GET['tags']):'').
1052 (!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')
1053 );
1048 exit; 1054 exit;
1049 } 1055 }
1050 1056