Skip to content
This repository has been archived by the owner on Aug 29, 2019. It is now read-only.

Commit

Permalink
Merge branch 'update-on-null-attributes'
Browse files Browse the repository at this point in the history
Signed-off-by: Edward F Long, Jr <edl@aweber.com>
  • Loading branch information
Edward F Long, Jr committed Sep 19, 2012
2 parents 4c4b0e6 + bdec39b commit 595ce09
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -61,6 +61,10 @@ subscriber information.

Changelog:
----------
2012-09-19: v1.1.6
* Fixed a bug that prevented resource attributes from being saved when the initial value of the resource attribute was null.
* used array_key_exists instead of isset for evaluation of associative arrays. Requires PHP >= 4.0.7

2012-07-05: v1.1.5
* Fixed a bug were a utf8_encode notice was raised when updating subscriber custom field values.

Expand Down
2 changes: 1 addition & 1 deletion aweber_api/aweber.php
Expand Up @@ -122,7 +122,7 @@ protected function readResponse($response, $url) {
$this->adapter->parseAsError($response);
if (!empty($response['id'])) {
return new AWeberEntry($response, $url, $this->adapter);
} else if (isset($response['entries'])) {
} else if (array_key_exists('entries', $response)) {
return new AWeberCollection($response, $url, $this->adapter);
}
return false;
Expand Down
2 changes: 1 addition & 1 deletion aweber_api/aweber_collection.php
Expand Up @@ -151,7 +151,7 @@ protected function _type() {
* @return integer
*/
protected function _calculatePageSize() {
if (isset($this->data['next_collection_link'])) {
if (array_key_exists('next_collection_link', $this->data)) {
$url = $this->data['next_collection_link'];
$urlParts = parse_url($url);
if (empty($urlParts['query'])) return $this->pageSize;
Expand Down
2 changes: 1 addition & 1 deletion aweber_api/aweber_entry.php
Expand Up @@ -159,7 +159,7 @@ public function __get($value) {
* @access public
*/
public function __set($key, $value) {
if (isset($this->data[$key])) {
if (array_key_exists($key, $this->data)) {
$this->_localDiff[$key] = $value;
return $this->data[$key] = $value;
} else {
Expand Down
2 changes: 1 addition & 1 deletion aweber_api/aweber_response.php
Expand Up @@ -62,7 +62,7 @@ public function __get($value) {
if (in_array($value, $this->_privateData)) {
return null;
}
if (isset($this->data[$value])) {
if (array_key_exists($value, $this->data)) {
return $this->data[$value];
}
if ($value == 'type') return $this->_type();
Expand Down

0 comments on commit 595ce09

Please sign in to comment.