This commit is contained in:
Martin Stadler
2017-01-26 12:39:28 +01:00
commit 7c355dfd2d
724 changed files with 6154 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
<?php
class Message {
/**
* Fehler beim Senden bzw. Speichern der Nachricht.
*/
public $error = false;
/**
* Nachricht enthält möglicherweise Spam.
*/
public $spam = false;
/**
* Gibt an, ob der Eintrag Spam enthalten könnte.
* Prüft, ob Zeilenumbrüche in den Werten von einzeiligen Eingabefeldern vorhanden sind.
* Prüft, ob der übergebene String einen Eintrag der Blacklist enthält.
*/
protected function contains_spam_hints ($test_string, $input) {
foreach ($input as $value) {
if (preg_match('~[\n\r]~', $value)) {
$this->spam = true;
return true;
}
}
$blacklist = array(
'~Content\-T~i',
'~href=~i',
'~http://.+?http://.+?http://~s',
);
foreach ($blacklist as $blackstring) {
if (preg_match($blackstring, $test_string)) {
$this->spam = true;
return true;
}
}
return false;
}
}
?>