Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Sources/Actions/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,18 @@ public function show(): void
*/
public function checkUsername(): void
{
// Who are you again?
if (empty($_COOKIE) || empty($_COOKIE[Config::$cookiename]) || empty($_SERVER['HTTP_REFERER']) || stripos($_SERVER['HTTP_REFERER'], Config::$scripturl) !== 0) {
/*
* Who are you again? Somebody with a session, who got here from a page
* of ours. Config::$cookiename is the login cookie, and the person
* filling in the registration form has not got one by definition, so
* asking for it turns everybody this is for away.
*/
if (empty($_COOKIE) || empty($_SERVER['HTTP_REFERER']) || stripos($_SERVER['HTTP_REFERER'], Config::$scripturl) !== 0) {
// And that is the whole answer. Carrying on would send the status
// and then the very thing it was refusing.
Utils::sendHttpStatus(403);

Utils::obExit(false);
}

// This is XML!
Expand Down