[FATAL ] SQL-Injektions werden verhindert
-Es werden nur Eingaben des Typs '[a-z]+\\.[a- z]+@adolfinum+\\.de$' an die mySQL Tabelle weiter gebeben.
This commit is contained in:
@@ -68,8 +68,9 @@ public class VotingController {
|
|||||||
|
|
||||||
@RequestMapping("/vote")
|
@RequestMapping("/vote")
|
||||||
public String VerifyName(@RequestParam String name, Model model) {
|
public String VerifyName(@RequestParam String name, Model model) {
|
||||||
|
if (name.strip().toLowerCase().matches("[a-z]+\\.[a-z]+@adolfinum+\\.de$")) {
|
||||||
try {
|
try {
|
||||||
Voter voter = voterRepository.findByEmail(name);
|
Voter voter = voterRepository.findByEmail(name.toLowerCase().strip());
|
||||||
if (voter.getVote_status()) {
|
if (voter.getVote_status()) {
|
||||||
LOGGER.warn(name + " has already voted");
|
LOGGER.warn(name + " has already voted");
|
||||||
return "errors/alreadyVoted.html";
|
return "errors/alreadyVoted.html";
|
||||||
@@ -84,6 +85,8 @@ public class VotingController {
|
|||||||
return "errors/notRegistered.html";
|
return "errors/notRegistered.html";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return "errors/wrongEmail.html";
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("/processVote")
|
@RequestMapping("/processVote")
|
||||||
public String ProcessVote(@RequestParam String name) {
|
public String ProcessVote(@RequestParam String name) {
|
||||||
|
|||||||
Reference in New Issue
Block a user