From 75cbc57bed224a156cbacc6a0c5f062a6ee54cc3 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 25 Jan 2019 14:39:52 -0500 Subject: [PATCH] Fix the bad prepare call. Also test for the user_id and user_id['ID'] --- models/admin/dashboard/leads.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/models/admin/dashboard/leads.php b/models/admin/dashboard/leads.php index 784901b..7114bea 100644 --- a/models/admin/dashboard/leads.php +++ b/models/admin/dashboard/leads.php @@ -105,24 +105,21 @@ class GlmMembersAdmin_dashboard_leads // extends GlmDataEvents // See if this member has a saved search. // If the do not then give message about it. $user_id = $this->config['loggedInUser']['wpUser']; - if ( $user_id ) { + if ( isset( $user_id ) && $user_id['ID'] ) { $last_search = $this->wpdb->get_row( $this->wpdb->prepare( "SELECT * FROM " . GLM_MEMBERS_LEADS_PLUGIN_DB_PREFIX . "searches WHERE user_id = %d", - $user_id + $user_id['ID'] ), ARRAY_A ); if ( $last_search ) { $hasLastDownload = true; $lastSearchDate = $last_search['date_created']; - //echo '
$last_search: ' . print_r( $last_search, true ) . '
'; $last_search_params = $last_search['search']; - //echo '
$last_search_params: ' . print_r( $last_search_params, true ) . '
'; $search_params = unserialize( $last_search_params ); - //echo '
$search_params: ' . print_r( $search_params, true ) . '
'; } } -- 2.17.1