From dad4caa7e5a76c07e36615bbfbda5f8afb82626d Mon Sep 17 00:00:00 2001 From: azaozz Date: Sun, 8 Feb 2009 04:20:34 +0000 Subject: [PATCH] Fix PHP notices in HTTP API Cookies, props beaulebens, fixes #9068 git-svn-id: http://svn.automattic.com/wordpress/trunk@10524 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/http.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wp-includes/http.php b/wp-includes/http.php index 1c06bf611..7503946c6 100644 --- a/wp-includes/http.php +++ b/wp-includes/http.php @@ -1385,12 +1385,18 @@ class WP_Http_Cookie { $this->$key = $val; } } else { + if ( !isset( $data['name'] ) ) + return false; + // Set properties based directly on parameters - $this->name = $data['name']; - $this->value = $data['value']; - $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); - $this->path = $data['path']; - $this->domain = $data['domain']; + $this->name = $data['name']; + $this->value = isset( $data['value'] ) ? $data['value'] : ''; + $this->path = isset( $data['path'] ) ? $data['path'] : ''; + $this->domain = isset( $data['domain'] ) ? $data['domain'] : ''; + if ( isset( $data['expires'] ) ) + $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); + else + $this->expires = null; } }