dam-spam/modules/check-form.php
2025-11-23 20:28:22 -07:00

22 lines
667 B
PHP

<?php
if ( !defined( 'ABSPATH' ) ) {
status_header( 404 );
exit;
}
class dam_spam_check_form extends dam_spam_module {
public function process( $ip, &$stats = array(), &$options = array(), &$post = array() ) {
$uri = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
if ( strpos( $uri, 'wp-comments-post.php' ) !== false ) {
return false;
}
if ( strpos( $uri, 'wp-login.php' ) !== false ) {
return false;
}
// translators: %s is the URI that's not a standard form
return sprintf( esc_html__( 'Post request not in wp-comments-post.php or wp-login.php — %s', 'dam-spam' ), $uri );
}
}
?>