警告:array_combine()[function.array-combine]:

时间:2019-01-12 13:29:47

标签: php warnings array-combine

在使用Estatik插件的帮助下,在我们的网站http://jsgofficespace.co.in中添加新列表时出现错误。

我在“属性”详细信息,功能,便利设施和印度货币符号的“类型”中添加了更多字段。但是之后,我开始添加新属性,而不是出现以下错误

  

警告:array_combine()[function.array-combine]:两个参数   至少应包含1个元素   /home/content/32/3315632/html/jsgofficespae/wp-content/plugins/estatik/classes/class-property.php   在第570行

     

警告:无法修改标头信息-标头已由发送   (输出开始于   /home/content/32/3315632/html/jsgofficespae/wp-content/plugins/estatik/classes/class-property.php:570)   在/home/content/32/3315632/html/jsgofficespae/wp-includes/option.php中   在第919行

     

警告:无法修改标头信息-标头已由发送   (输出开始于   /home/content/32/3315632/html/jsgofficespae/wp-content/plugins/estatik/classes/class-property.php:570)   在/home/content/32/3315632/html/jsgofficespae/wp-includes/option.php中   在第920行

class-property.php中的553至573行

public static function save( $post_id, $post )
{
    if ( $post->post_type == static::get_post_type_name() ) {
        // Initialize property object.
        $property = new static( $post_id );
        // Get property fields data from the post request.
        $data = filter_input( INPUT_POST, 'property', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
        // Save these fields.
        $property->save_fields( $data );

        // Saving custom property data fields (that created manually).
        $keys = filter_input(INPUT_POST, 'es_custom_key', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
        $values = filter_input(INPUT_POST, 'es_custom_value', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);

        $keys = $keys ? $keys : array();
        $values = $values ? $values : array();

        $custom_data = array_combine( $keys, $values );
        $property->save_custom_data( $custom_data );
    }
}

并且option.php中的第917至921行

// The cookie is not set in the current browser or the saved value is newer.
$secure = ( 'https' === parse_url( admin_url(), PHP_URL_SCHEME ) );
setcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
setcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure );
$_COOKIE['wp-settings-' . $user_id] = $settings;

0 个答案:

没有答案