WordPress.org

Ready to get started?Download WordPress

Forums

Pugin SEO Ultimate error: PHP Deprecated Function eregi_replace (4 posts)

  1. William Henostroza
    Member
    Posted 1 year ago #

    Hello,

    In the server log is the following message:

    PHP Deprecated: Function eregi_replace() is deprecated in /home/wihe/public_html/myspace.wihe.net/wp-content/plugins/seo-ultimate/modules/titles/titles.php

    Solutions?

    Regards

  2. pcaines
    Member
    Posted 1 year ago #

    in the titles.php change:

    return eregi_replace('<title>[^<]*</title>', '<title>'.$title.'</title>', $head);

    to

    return preg_match('/<title>[^<]*</title>/', '<title>'.$title.'</title>', $head);

  3. stevejbrobinson
    Member
    Posted 1 year ago #

    pcaines, that doesn't work for me.

    This does:
    Change:
    return eregi_replace('<title>[^<]*</title>', '<title>'.$title.'</title>', $head);

    To:

    $pattern = '/<title>([^<]*)<\/title>/is';
    $replace = '<title>'.$title.'</title>';
    return preg_replace($pattern, $replace, $head);
  4. pcaines
    Member
    Posted 1 year ago #

    Yes you are right, thanks for the update

Topic Closed

This topic has been closed to new replies.

About this Topic