我如何解决这个问题?

优雅

我在 wordpress 上收到了这个通知

常量 PHP_INT_MIN - 在第 488 行的 /home/myusername/public_html/wordpress/wp-content/plugins/wpsso/lib/com/util.php 中假定为“PHP_INT_MIN”。

我该如何解决?

add_filter( $filter_name, array( __CLASS__, 'filter_value_save' ), PHP_INT_MIN, 1 );
        add_filter( $filter_name, array( __CLASS__, 'filter_value_restore' ), PHP_INT_MAX, 1 );

        return true;
    }

    public static function remove_filter_protection( $filter_name ) {
        if ( ! has_filter( $filter_name, array( __CLASS__, 'filter_value_restore' ) ) ) {
            return false;
        }
        remove_filter( $filter_name, array( __CLASS__, 'filter_value_save' ), PHP_INT_MIN );
        remove_filter( $filter_name, array( __CLASS__, 'filter_value_restore' ), PHP_INT_MAX );
内森·道森

PHP_INT_MIN 是 PHP 中的预定义常量,自 PHP7 起就可用。

PHP_INT_MAX 另一方面,自 PHP5 的早期版本以来就已经存在。

您在使用旧版 PHP(pre-7)的服务器上运行该站点,因此无法访问该PHP_INT_MIN常量。该通知告诉您该常量不存在,因此将其转换为字符串。

http://php.net/manual/en/reserved.constants.php

由于此问题发生在第三方插件中,因此您不应自行修改代码。您有几种选择,包括联系您的主机以更新您的 PHP 版本;将问题通知插件作者并希望他们发布修复程序;或在适当的位置自己手动定义常量。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章