forked from leftypol/leftypol
SECURITY: fix XSS vulnerability
This commit is contained in:
parent
ba6744a1c6
commit
56eaf863f2
2 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
checkBan();
|
||||
$text = isset($_POST['text']) ? $_POST['text'] : '';
|
||||
if(strlen($text)>0 && !preg_match('/a href/', $text)) {
|
||||
file_put_contents("attentionbar.txt",$text);
|
||||
file_put_contents("attentionbar.txt",htmlspecialchars($text));
|
||||
if(strlen($_SERVER['HTTP_REFERER'])>0) { header('Location: ' . $_SERVER['HTTP_REFERER']); }
|
||||
else { header('Location: /'); }
|
||||
} else print(file_get_contents("attentionbar.txt"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue