mirror of
https://gh.wpcy.net/https://github.com/webguyio/stop-spammers-classic.git
synced 2026-05-26 02:02:57 +08:00
32 lines
No EOL
710 B
PHP
32 lines
No EOL
710 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class chkshort { // change name
|
|
public $searchname = 'Email/Username Too Short';
|
|
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
|
|
if ( array_key_exists( 'email', $post ) ) {
|
|
$email = $post['email'];
|
|
if ( !empty( $email ) ) {
|
|
if ( strlen( $email ) < 5 ) {
|
|
return 'Email Too Short: ' . $email;
|
|
}
|
|
}
|
|
}
|
|
if ( array_key_exists( 'author', $post ) ) {
|
|
if ( !empty( $post['author'] ) ) {
|
|
$author = $post['author'];
|
|
// short author is OK?
|
|
if ( strlen( $post['author'] ) < 3 ) {
|
|
return 'Username Too Short: ' . $author;
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
?>
|