mirror of
https://gh.wpcy.net/https://github.com/webguyio/stop-spammers-classic.git
synced 2026-07-13 21:11:05 +08:00
19 lines
No EOL
583 B
PHP
19 lines
No EOL
583 B
PHP
<?php
|
|
|
|
if ( !defined( 'ABSPATH' ) ) {
|
|
status_header( 404 );
|
|
exit;
|
|
}
|
|
|
|
class chkurls {
|
|
// look on option list for URLs
|
|
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
|
|
$comment = explode( " ", $post['comment'] );
|
|
for ( $i = 0 ; $i < count( $comment ) ; $i++ ) {
|
|
if ( preg_match( '/^[a-z0-9_]+([\\-\\.]{1}[a-z_0-9]+)*\\.[_a-z]{2,5}+'.'((:[0-9]{1,5})?\\/.*)?$/i', $comment[$i] ) OR strpos( $comment[$i], 'http://' ) !== false OR strpos( $comment[$i], 'https://' ) !== false ) {
|
|
return 'URL Detected';
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
} |