diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-25 20:54:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-25 20:54:48 +0100 |
commit | 06cb3300f317856a9bbc243ef54042e6ad5cdc1c (patch) | |
tree | dc50ac2bc507387a4f9de61b65259d0120669a21 | |
parent | bae74cb292833a4482b3a42b78c020b7f97b7ffd (diff) | |
parent | 0b04f7970c92038480ad363e92b00a99971b1820 (diff) | |
download | Shaarli-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.php | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 | ||