From 40a91afb5d7bce3376eaf949df8a0f75880ed58a Mon Sep 17 00:00:00 2001 From: Andrew Ozz 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: https://develop.svn.wordpress.org/trunk@10524 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 1c06bf611d..7503946c68 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; } }