The MU forums have moved to WordPress.org

preg-replace error (6 posts)

  1. Bloggproffs
    Member
    Posted 15 years ago #

    IM getting this error over and over again in my error_log:

    [29-Oct-2007 16:16:17] PHP Warning: preg_replace() [function.preg-replace]: Empty regular expression in /home/bloggpro/public_html/wp-includes/formatting.php on line 654

    This is line 644 and forward
    function convert_smilies($text) {
    global $wp_smiliessearch, $wp_smiliesreplace;
    $output = '';
    if (get_option('use_smilies')) {
    // HTML loop taken from texturize function, could possible be consolidated
    $textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
    $stop = count($textarr);// loop stuff
    for ($i = 0; $i < $stop; $i++) {
    $content = $textarr[$i];
    if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
    $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
    }
    $output .= $content;
    }
    } else {
    // return default text.
    $output = $text;
    }
    return $output;
    }

    I havent ever been in that file, so no changes have been made to it, anyone got an idea?

  2. theapparatus
    Member
    Posted 15 years ago #

    Any chance you can match it up with your webserver's logs to see what page is being accessed to see what content is causing that issue?

  3. Bloggproffs
    Member
    Posted 15 years ago #

    hm no sadly not, didnt do any changes the day before, during nor the day after.

    its alot of errors_ maybe a few hunderd a day..

  4. Bloggproffs
    Member
    Posted 15 years ago #

    Is noone else experiencing this error? im getting it several times a minute... error_log gets huge each day..

  5. suleiman
    Member
    Posted 14 years ago #

    In the latest build comment out this line number 685 from your wp-includes/formatting.php file:

    $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);

    Should fix your errors.

  6. amanzi
    Member
    Posted 14 years ago #

    I just started experiencing this error on my site. Commenting out that line also fixed the issue, but I'd like to know what caused it?

About this Topic

  • Started 15 years ago by Bloggproffs
  • Latest reply from amanzi