最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

multisite - Error while localizing communityEventsData in script-loader.php

programmeradmin1浏览0评论

I'm getting an error in my logs:

NOTICE: PHP message: PHP Warning:  Cannot assign an empty string to a string offset in /usr/share/nginx/wp/wp-includes/class.wp-scripts.php on line 492

So I got the stack trace:

Array
(
    [0] => Array
        (
            [file] => /usr/share/nginx/wp/wp-includes/functions.wp-scripts.php
            [line] => 221
            [function] => localize
            [class] => WP_Scripts
            [type] => ->
            [args] => Array
                (
                    [0] => dashboard
                    [1] => communityEventsData
                    [2] => Array
                        (
                            [nonce] => 0c29524bac
                            [cache] => 
                            [time_format] => g:i a
                        )

                )

        )

I think that because the key [cache] is empty, this is generating the warning in class.wp-scripts.php Isn't that all WP core? Their check to skip is if ( ! is_scalar( $value ) ) and before the last update I had changed that to if ( ! is_scalar( $value ) || empty( $value) ) but of course that was overwritten last update. I'm wondering if I'm missing something or if it's a minor oversight in core.

发布评论

评论列表(0)

  1. 暂无评论