WordPress.org

Ready to get started?Download WordPress

Forums

iThemes Security (formerly Better WP Security)
[resolved] [Plugin: Better WP Security] SQL errror in function lockout() (2 posts)

  1. b.l.k
    Member
    Posted 1 year ago #

    Hello,
    there is an SQL error in the function lockout() in secure.php when BWPS tries to ban an host:

    $wpdb->insert(
    	$wpdb->base_prefix . 'bwps_lockouts',
    	array(
    		'type' => $type,
    		'active' => 1,
    		'starttime' => $currtime,
    		'exptime' => $exptime,
    		'host' => $wpdb->escape( $_SERVER['REMOTE_ADDR'] ),
    		'user' => ''
    	)
    );

    the column user is defined as bigint(20) and an empty string is sent in the query.

    The correct query should be :

    $wpdb->insert(
    	$wpdb->base_prefix . 'bwps_lockouts',
    	array(
    		'type' => $type,
    		'active' => 1,
    		'starttime' => $currtime,
    		'exptime' => $exptime,
    		'host' => $wpdb->escape( $_SERVER['REMOTE_ADDR'] ),
    		'user' => 0
    	)
    );

    or maybe you can try to send NULL ?

    Could you confirm this is an error and fix it in the next release ?

    Thank you for your answer

    http://wordpress.org/extend/plugins/better-wp-security/

  2. Thanks for the report. I will fix it for the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.