Merge pull request #834 from philipp-r/issue-833
Tags parameter for redirects
This commit is contained in:
commit
06cb3300f3
1 changed files with 9 additions and 3 deletions
12
index.php
12
index.php
|
@ -432,7 +432,7 @@ function ban_canLogin($conf)
|
||||||
// Optional redirect after login:
|
// Optional redirect after login:
|
||||||
if (isset($_GET['post'])) {
|
if (isset($_GET['post'])) {
|
||||||
$uri = '?post='. urlencode($_GET['post']);
|
$uri = '?post='. urlencode($_GET['post']);
|
||||||
foreach (array('description', 'source', 'title') as $param) {
|
foreach (array('description', 'source', 'title', 'tags') as $param) {
|
||||||
if (!empty($_GET[$param])) {
|
if (!empty($_GET[$param])) {
|
||||||
$uri .= '&'.$param.'='.urlencode($_GET[$param]);
|
$uri .= '&'.$param.'='.urlencode($_GET[$param]);
|
||||||
}
|
}
|
||||||
|
@ -461,7 +461,7 @@ function ban_canLogin($conf)
|
||||||
$redir = '&username='. $_POST['login'];
|
$redir = '&username='. $_POST['login'];
|
||||||
if (isset($_GET['post'])) {
|
if (isset($_GET['post'])) {
|
||||||
$redir .= '&post=' . urlencode($_GET['post']);
|
$redir .= '&post=' . urlencode($_GET['post']);
|
||||||
foreach (array('description', 'source', 'title') as $param) {
|
foreach (array('description', 'source', 'title', 'tags') as $param) {
|
||||||
if (!empty($_GET[$param])) {
|
if (!empty($_GET[$param])) {
|
||||||
$redir .= '&' . $param . '=' . urlencode($_GET[$param]);
|
$redir .= '&' . $param . '=' . urlencode($_GET[$param]);
|
||||||
}
|
}
|
||||||
|
@ -1044,7 +1044,13 @@ function renderPage($conf, $pluginManager, $LINKSDB)
|
||||||
// Show login screen, then redirect to ?post=...
|
// Show login screen, then redirect to ?post=...
|
||||||
if (isset($_GET['post']))
|
if (isset($_GET['post']))
|
||||||
{
|
{
|
||||||
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.
|
header( // Redirect to login page, then back to post link.
|
||||||
|
'Location: ?do=login&post='.urlencode($_GET['post']).
|
||||||
|
(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').
|
||||||
|
(!empty($_GET['description'])?'&description='.urlencode($_GET['description']):'').
|
||||||
|
(!empty($_GET['tags'])?'&tags='.urlencode($_GET['tags']):'').
|
||||||
|
(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')
|
||||||
|
);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue