note 73384 added to function.preg-match
| From: | brad at winwdesign dot com | Date: | Tue, 20 Feb 2007 22:58:44 +0000 |
| Subject: | note 73384 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123618@lists.php.net to get a copy of this message | ||
Yet another attempt at anti-spam:
$pattern = '/[.]+(|aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs
|mobi|mil|museum|name|net|org|pro|root|tel|travel|ac
|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az
|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bw|by
|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx
|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj
|fk|fm|fo|fr|ga|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr
|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq
|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kr|kw|ky|kz|la
|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mk|ml|mm
|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc
|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk
|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd
|se|sg|sh|si|sk|sl|sm|sn|sr|st|sv|sy|sz|tc|td|tf|tg|th
|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va
|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$/ix';
$message = "Entering domain extensions like .com, .net .org or country code domains like .uk,
.tw are not allowed in the Message field.";
if (preg_match($pattern, "$message"))
{
include("antiSpamPage.inc");
exit();
}
Any improvements are welcome.
----
Server IP: 64.71.164.2
Probable Submitter: 71.229.195.216
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/73384
Del: integrated -- https://master.php.net/note/delete/73384/integrated
Del: useless -- https://master.php.net/note/delete/73384/useless
Del: bad code -- https://master.php.net/note/delete/73384/bad+code
Del: spam -- https://master.php.net/note/delete/73384/spam
Del: non-english -- https://master.php.net/note/delete/73384/non-english
Del: in docs -- https://master.php.net/note/delete/73384/in+docs
Del: other reasons-- https://master.php.net/note/delete/73384
Reject -- https://master.php.net/note/reject/73384
Search -- https://master.php.net/manage/user-notes.php