Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from bluehost/fix/ensure-value-is-present-and-i…
Browse files Browse the repository at this point in the history
…s-array

make sure value exists and that it is array before checking for keys
  • Loading branch information
wpscholar authored Aug 18, 2022
2 parents 81b4a03 + 70c0c29 commit 84a7dae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class Customer {
public static function collect() {
$bh_cdata = Transient::get( self::TRANSIENT );

if ( ! array_key_exists( 'signup_date', $bh_cdata ) ||
if ( $bh_data &&
is_array( $bh_cdata ) &&
! array_key_exists( 'signup_date', $bh_cdata ) ||
! array_key_exists( 'plan_subtype', $bh_cdata ) ) {
$bh_cdata = false;
Transient::delete( self::TRANSIENT );
Expand All @@ -48,7 +50,7 @@ public static function collect() {
if ( ! $bh_cdata ) {
$guapi = self::get_account_info();
$mole = self::get_onboarding_info();
if ( empty( $guapi ) || empty( $mole ) ) {
if ( empty( $guapi ) ) {
return false;
}
$bh_cdata = array_merge( $guapi, array( 'meta' => $mole ) );
Expand Down

0 comments on commit 84a7dae

Please sign in to comment.