From c8bccecc2327316626a12729806f7018d3d3d3a2 Mon Sep 17 00:00:00 2001 From: czaks Date: Mon, 6 Jan 2014 04:14:51 +0100 Subject: attention bar: iteration of fixes --- attentionbar.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'attentionbar.php') diff --git a/attentionbar.php b/attentionbar.php index e928daae..18a5d9ac 100644 --- a/attentionbar.php +++ b/attentionbar.php @@ -1,8 +1,9 @@ 0) { - file_put_contents("attentionbar.txt",$_POST["text"]); + $text = isset($_POST['text']) ? $_POST['text'] : ''; + if(strlen($text)>0 && !preg_match('/a href/', $text)) { + file_put_contents("attentionbar.txt",$text); if(strlen($_SERVER['HTTP_REFERER'])>0) { header('Location: ' . $_SERVER['HTTP_REFERER']); } else { header('Location: /'); } } else print(file_get_contents("attentionbar.txt")); -- cgit v1.3