Prevents ?do=addlink from generating a 404 if the user is not logged in
Fixes https://github.com/shaarli/Shaarli/issue/47
This commit is contained in:
parent
194cd1cd16
commit
e267bf2772
1 changed files with 8 additions and 0 deletions
|
@ -1410,6 +1410,14 @@ function renderPage()
|
||||||
header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
|
header('Location: ?do=login&post='.urlencode($_GET['post']).(!empty($_GET['title'])?'&title='.urlencode($_GET['title']):'').(!empty($_GET['source'])?'&source='.urlencode($_GET['source']):'')); // Redirect to login page, then back to post link.
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Same case as above except that user tried to access ?do=addlink without being logged in
|
||||||
|
// Note: passing empty parameters makes Shaarli generate default URLs and descriptions.
|
||||||
|
if (isset($_GET['do']) && $_GET['do'] === 'addlink') {
|
||||||
|
header('Location: ?do=login&post=');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
$PAGE = new pageBuilder;
|
$PAGE = new pageBuilder;
|
||||||
buildLinkList($PAGE,$LINKSDB); // Compute list of links to display
|
buildLinkList($PAGE,$LINKSDB); // Compute list of links to display
|
||||||
$PAGE->renderPage('linklist');
|
$PAGE->renderPage('linklist');
|
||||||
|
|
Loading…
Reference in a new issue