Error "Cannot assign an Empty string to a string offset" in Wordpress

Asked

Viewed 182 times

0

I used the version of WP 4.9.3, after upgrading to the latest version which is 5.0.3, began to appear the following error message:

"Warning: Cannot assign an Empty string to a string offset in /home/nfe/public_html/wp-includes/class.wp-scripts.php on line 445"

I wonder if anyone has ever had the same mistake, if so, how it was resolved. The error appears in the following code:

foreach ( (array) $l10n as $key => $value ) {
  if ( !is_scalar($value) )
    continue;
  $l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
}
  • How do we know what’s in the file /home/nfe/public_html/wp-includes/class.wp-scripts.php and on the line 445? Post your code! ;)

  • I forgot, I already posted the error code.

  • try putting in if is_scalar || $key == "" ||$value == ""

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.