- Updates MailChimp API key regex

This commit is contained in:
Vlad
2016-11-22 12:44:58 -05:00
parent 6f49201393
commit 0c8cc27ea2
2 changed files with 4 additions and 4 deletions

View File

@@ -8,7 +8,7 @@ class MailChimp {
public $max_post_size;
public $data_center;
public $export_url;
const API_KEY_REGEX = '/[a-zA-Z0-9]{32}-[a-zA-Z0-9]{2,3}$/';
const API_KEY_REGEX = '/[a-zA-Z0-9]{32}-[a-zA-Z0-9]{2,4}$/';
function __construct($api_key, $lists = false) {
$this->api_key = $this->getAPIKey($api_key);

View File

@@ -18,8 +18,8 @@ class MailChimpTest extends MailPoetTest {
// the first part of the key must contain 32 characters,
expect($this->mailchimp->getAPIKey('1234567890123456789012345678901-123'))
->false();
// the second part must contain 2 or 3 characters
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-1234'))
// the second part must contain 2-4 characters
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-12345'))
->false();
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-1'))
->false();