From 33e80805adcd5974359953323a5fa2cf83f28659 Mon Sep 17 00:00:00 2001 From: Nikolai Kristiansen Date: Tue, 10 Jun 2014 00:08:09 +0200 Subject: [PATCH] Minor fix --- snapporder/lib/functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/snapporder/lib/functions.php b/snapporder/lib/functions.php index aebb678..8db3562 100644 --- a/snapporder/lib/functions.php +++ b/snapporder/lib/functions.php @@ -268,9 +268,13 @@ function institutions($output=true) { } function mailchimp_subscribe($data, $list_id, $api_key) { // Ref: http://apidocs.mailchimp.com/api/2.0/lists/subscribe.php + if(strlen($api_key) == 0) { + return false; + } + $double_optin = false; $send_welcome = false; - $dc = explode("-",$api_key)[1]; + list($not_used, $dc) = explode("-", $api_key); $submit_url = "https://$dc.api.mailchimp.com/2.0/lists/subscribe.json"; $data = array(