Skip to content

Commit

Permalink
$apiUrl endpoint is now prepended by the datacenter from the $apikey
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Feb 22, 2013
1 parent b033ae6 commit c91854d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion MAPI.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class MCAPI {
*/
function MCAPI($apikey, $secure=false) {
$this->secure = $secure;
$this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
$aAPIKey = explode("-", $apikey);
$apikey = sprintf("http://%s.api.mailchimp.com/%.1f/?output=php", $aAPIKey[1], $this->version);
$this->apiUrl = parse_url($apikey);
$this->api_key = $apikey;
}
function setTimeout($seconds){
Expand Down

0 comments on commit c91854d

Please sign in to comment.