mirror of
https://gh.wpcy.net/https://github.com/webguyio/stop-spammers-classic.git
synced 2026-05-27 02:04:00 +08:00
32 lines
No EOL
762 B
PHP
32 lines
No EOL
762 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class chkhyphens extends be_module {
|
|
public function process( $ip, &$stats=array(), &$options=array(), &$post=array() ) {
|
|
if ( array_key_exists( 'email', $post ) ) {
|
|
$email = $post['email'];
|
|
if ( !empty( $email ) ) {
|
|
$email = substr( $email, 0, strpos( $email, '@' ) );
|
|
if ( substr_count( $email, "-" ) > 1 ) {
|
|
return 'Too many hyphens in: ' . $email;
|
|
}
|
|
}
|
|
}
|
|
if ( array_key_exists( 'user_email', $post ) ) {
|
|
$email = $post['user_email'];
|
|
if ( !empty( $email ) ) {
|
|
$email = substr( $email, 0, strpos( $email, '@' ) );
|
|
if ( substr_count( $email, "-" ) > 1 ) {
|
|
return 'Too many hyphens in: ' . $email;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
?>
|