Forums

[resolved] WordPress broke in PHP 5.2.8 (3 posts)

  1. ksofttech
    Member
    Posted 1 year ago #

    Our host provider recently upgraded to PHP 5.2.8 and our WordPress page quit working. After extensive troubleshooting, it seems to be a bug in the PHP library function strstr which now "hangs" in some instances and causing WordPress to never fully render the page.

    I solved it by replacing calls to strstr (in the functions-formatting.php file - function wptexturize) with stristr.

    Hopefully this will save some folks some aggravation.

    -- Paul Kabotie

  2. ksofttech
    Member
    Posted 1 year ago #

    Actually, on second look - it seems there is a problem with the WordPress code - and the old strstr() was forgiving enough to let it pass - but the new version errors out.

    Old WP code:
    } elseif (strstr($curl, '<code') || strstr($curl, '<pre') || strstr($curl, '<kbd' || strstr($curl, '<style') || strstr($curl, '<script'))) {

    New fixed code (moving a paren):
    } elseif (strstr($curl, '<code') || strstr($curl, '<pre') || strstr($curl, '<kbd') || strstr($curl, '<style') || strstr($curl, '<script')) {

  3. ksofttech
    Member
    Posted 1 year ago #

    So just to clarify. I changed the code back to its original state (with the original calls to strstr()) and simply moved one parenthesis in order to solve the problem on my implementation.

    Simple fix after hours of tracking this sucker down!

Topic Closed

This topic has been closed to new replies.

About this Topic