Support » Installing WordPress » Bad Behavior 2.0.27: Error “Warning: preg_replace()”

  • 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/ on line 114

    Warning: Cannot modify header information – headers already sent by (output started at /path/to/plugins/bad-behavior/bad-behavior/ in /path/to/plugins/bad-behavior/bad-behavior/ 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/ 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!

Viewing 1 replies (of 1 total)
  • 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 (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!

Viewing 1 replies (of 1 total)
  • The topic ‘Bad Behavior 2.0.27: Error “Warning: preg_replace()”’ is closed to new replies.