WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Bad Behavior 2.0.27: Error "Warning: preg_replace()" (2 posts)

  1. nv1962
    Member
    Posted 4 years ago #

    Just upgraded to BB 2.0.27 and suddenly I get these:

    Warning: preg_replace() [function.preg-replace]: No ending delimiter '^' found in /path/to/plugins/bad-behavior/bad-behavior/core.inc.php on line 114

    Warning: Cannot modify header information - headers already sent by (output started at /path/to/plugins/bad-behavior/bad-behavior/core.inc.php:114) in /path/to/plugins/bad-behavior/bad-behavior/screener.inc.php on line 8

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /path/to/plugins/bad-behavior/bad-behavior/core.inc.php:114) in /path/to/plugins/enhanced-wordpress-contactform/wp-contactform.php on line 247

    Tried deleting the old (2.0.26) BB folder and upping the new version via FTP but no dice.

    I suppose the issue is a missing regex delimiter, but, uh, I'm not very good at this PHP / RegEx stuff...

    Help much appreciated!

  2. nv1962
    Member
    Posted 4 years ago #

    Aha! Thanks to Jonathan Lundell's tip posted at the Bad Behavior author's site, the solution is not only available but also very simple to apply.

    Just go to line 114 of the file core.inc.php (it's within the "secondary" plugin's sub-folder, which is also named bad-behavior!) and substitute that line with the following:
    $_SERVER['REMOTE_ADDR'] = preg_replace("/^::ffff:/", "", $_SERVER['REMOTE_ADDR']);
    Problem solved!

Topic Closed

This topic has been closed to new replies.

About this Topic