• Resolved danbeach

    (@danbeach)


    After updating from 6.3.2 to 6.4.1, my site is completely unusable. The error log has the following:

    PHP Fatal error:  Uncaught Error: Call to undefined function wp_kses() in /home/wp/wpdev/wp-includes/functions.php:6019
    Stack trace:
    #0 /home/wp/wpdev/wp-includes/functions.php(5500): wp_trigger_error('', 'Function wpdb::...', 16384)
    #1 /home/wp/wpdev/wp-includes/class-wpdb.php(1338): _deprecated_function('wpdb::escape', '3.6.0', 'wpdb::prepare()...')
    #2 /home/wp/wpdev/wp-content/sunrise.php(11): wpdb->escape('wpdev.stolaf.ed...')
    #3 /home/wp/wpdev/wp-includes/ms-settings.php(47): include_once('/home/wp/wpdev/...')
    #4 /home/wp/wpdev/wp-settings.php(141): require('/home/wp/wpdev/...')
    #5 /home/wp/wpdev/wp-config.php(163): require_once('/home/wp/wpdev/...')
    #6 /home/wp/wpdev/wp-load.php(50): require_once('/home/wp/wpdev/...')
    #7 /home/wp/wpdev/wp-blog-header.php(13): require_once('/home/wp/wpdev/...')
    #8 /home/wp/wpdev/index.php(17): require('/home/wp/wpdev/...')
    #9 {main}
    

    There’s an updated wp-settings.php file that has the require of kses.php, so I don’t know why the function would be undefined. I’ve restored me site to 6.3.2 and tried the update a second time with the same results.

    In case it matters, this is a multisite installation and has been ever since before WordPress supported multisite natively.

    Any suggestions?

    • This topic was modified 1 year ago by James Huff. Reason: moved to Networking WordPress since this is a multisite issue
Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator t-p

    (@t-p)

    Please review WordPress 6.4 Master List and attempt troubleshooting steps recommended therein.

    Thread Starter danbeach

    (@danbeach)

    Thanks for the confirmation. I believe I’ve traced it down to a custom theme/plugin that we use but it’s been very difficult to get a useful error message to track what function or other part of the code is failing. For the time being, I’m also locking the production site to 6.3.2 until we can figure it out.

    Moderator t-p

    (@t-p)

    Glad you got it sorted ??

    Thread Starter danbeach

    (@danbeach)

    I just wanted to follow-up in case anyone ever runs into this (unlikely, though). The problem wasn’t the theme or a plugin. It was the sunrise.php drop-in that I’ve had for many years to support multiple domains in my multisite. The site was set up before version 4.5 when domain mapping was integrated into core. Everything continued to work with it until 6.4.

    I think I’m having the same issue with sunrise.php on my mutisite. I’ve also had a multisite for quite a while. After I updated to 6.41, I got the error: Uncaught Error: Call to undefined function wp_kses()…

    Can you tell me how you fixed it? Thank you!

    Thread Starter danbeach

    (@danbeach)

    I found a slightly different (newer?) sunrise.php file and put that in place and all worked afterwards. The differences are super minor, but the key line that needs fixing is:

    Old one (line 10 or 11):

    $dm_domain = $wpdb->escape( $_SERVER[ 'HTTP_HOST' ] );

    New one:

    $dm_domain = $_SERVER[ 'HTTP_HOST' ];

    Essentially, the call to the “escape” function triggers the call to wp_kses(). I believe there’s been a change in ordering for when some include files are read so that function isn’t defined at the time.

    Thanks for posting your fix! Unfortunately my sunrise.php file already uses that new code so there must be something else going on.

    londonnet

    (@londonnet)

    Hey, this helped me get the admin and the main site backup but I still get the same fatel error for all the subsites.

    Is there a second step for getting this working with sunrise.php and multisite?

    Thanks

    Thread Starter danbeach

    (@danbeach)

    There wasn’t a second step for me. Everything just started working with the newer sunrise.php. Could caching (either on the server or your browser) be the culprit? Just a wild guess.

    Just spent some time on this, the solution is to replace wp-content/sunrise.php by wp-content/plugins/wordpress-mu-domain-mapping/sunrise.php

    The fix from danbeach is not enough, it’s fixing only the main site, not subsite, like londonnet said

    But it’s unclear why we still use sunrise.php. I read posts saying it’s not neccessary anymore and I have a more recent wordpress multisite installation without sunrise.php in my wp-config. I tried to remove it on my older wordpress multisite, but it’s not morking without it.

    • This reply was modified 9 months, 3 weeks ago by contremaitre.
    • This reply was modified 9 months, 3 weeks ago by contremaitre.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘6.4.1 update causes fatal error’ is closed to new replies.