PHP Warning: Array to string conversion in wp-includes/formatting.php

  • Unknown's avatar

    Hi

    We keep getting the ollowing in our hosting provider’s PHP error log.

    PHP Warning: Array to string conversion in /nas/content/live/bagsofbomaster/wp-includes/formatting.php on line 1128

    The line in question is in the function wp_check_invalid_utf8 and is $text = (string) $text;

    I’ve seen this was raised once before on the forum but there was nothing to help resolve this. We don’t have any plugin conflicts that I can see. I also can’t determine where it’s called.

    Regards
    Matt

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    We can’t help as that site isn’t running on the wordpress;.om platform – https://wordpress.com/site-profiler/http://bags-of-books.co.uk

    You must dig deeper into the logs of your site or take a look in the documentation at wordpress.org

  • Unknown's avatar

    This is a less than helpful response.

    The error is found in wp-includes/formatting.php and as we are using WordPress, all be it on a WP Engine hosted platform, I’m assuming that this is a WordPress supplied file especially as the information at the top of the file states that… ‘it’s the Main WordPress Formatting API and Handles many functions for formatting output. @package WordPress‘. This would strongly suggest it is supplied by WordPress.

    Rather than just dismissing this support request please can you look at the file in question and see why the statement $text = (string) $text; which is the first statement in the function wp_check_invalid_utf8( $text, $strip = false ) is causing the Array to string conversion error.

    Kind Regards
    Matt

  • Hi @mattgivertzgmailcom! Sorry to hear about the issue you’re facing.

    Since your site isn’t hosted on WordPress.com, you’ll need to ask your question on the WordPress.org community forums at this link:

     https://wordpress.org/support/forum/how-to-and-troubleshooting/ 

    That forum is perfect for sites like yours that use WordPress software but aren’t hosted with WordPress.com.

    If you’re curious about the difference between WordPress.com and WordPress.org, this guide explains it quite well:

    https://wordpress.com/support/com-vs-org/

    Please let us know if you have any questions or need any extra help, and we’ll be happy to assist you.

Log in or create an account to reply