WordPress.org

Forums

WP Mail SMTP
PHP 5.3 - ereg() deprecated (1 post)

  1. dyelawn
    Member
    Posted 2 years ago #

    If your server is running PHP 5.3+, you'll get a deprecation notice when ereg() is called on line 351 of wp_mail_smtp.php. This can be fixed by replacing the regex email check with PHP's built-in filter_var() function for checking emails:

    // replace the following on lines 351-353
    if (preg_match('^[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+'.'@'.
            '[-!#$%&\'*+\\/0-9=?A-Z^_a-z{|}~]+\.'.
            '[-!#$%&\'*+\\./0-9=?A-Z^_a-z{|}~]+$', $email))
    
    // change to:
    if (filter_var($email, FILTER_VALIDATE_EMAIL))

    http://wordpress.org/extend/plugins/wp-mail-smtp/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Mail SMTP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic