-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- separate controller and view (all html output is now free from program logic) this makes the code more **readable**. It should now be easier to spot security issues and write **clean code**. - separate javascript from html. This partly belongs to the first point but I list it extra because this allows us to introduce a `Content-Security-Policy` which should **remove any threat of Cross-Site-Scripting** - Introduced header `X-Frame-Options` to prevent **clickjacking**. - Fix a small information disclosure vulnerability (finding out which users exist)
- Loading branch information
1 parent
ad7f2bf
commit 9898201
Showing
17 changed files
with
1,862 additions
and
1,675 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
header('X-Content-Type-Options: nosniff'); | ||
header('Content-Type: application/json'); | ||
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0"); | ||
function error($msg) { | ||
echo json_encode(array("status" => "error", "message" => $msg)); | ||
die(); | ||
} | ||
if ($_SERVER['REQUEST_METHOD'] !== 'POST'){ | ||
error('Wrong method'); | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.