Cannot assign an empty string to a string offset Warning in Wordpress

admin

Administrator
Staff member
When i load the page it displays the following warning:

<blockquote>
Warning: Cannot assign an empty string to a string offset in
C:xampp\htdocs\wordpress\smart-m\wp-includes\class.wp-scripts.php on
line 447
</blockquote>

I think its not logical problem. Can be something due to wordpress ?
That's the function in wp-scripts.php file on line 447

Code:
public function localize( $handle, $object_name, $l10n ) {
        if ( $handle === 'jquery' )
            $handle = 'jquery-core';

        if ( is_array($l10n) &amp;&amp; isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present
            $after = $l10n['l10n_print_after'];
            unset($l10n['l10n_print_after']);
        }

        foreach ( (array) $l10n as $key =&gt; $value ) {
            if ( !is_scalar($value) )
                continue;

            $l10n[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
        }

        $script = "var $object_name = " . wp_json_encode( $l10n ) . ';';

        if ( !empty($after) )
            $script .= "\n$after;";

        $data = $this-&gt;get_data( $handle, 'data' );

        if ( !empty( $data ) )
            $script = "$data\n$script";

        return $this-&gt;add_data( $handle, 'data', $script );
    }