- Updates MailChimp API key regex
This commit is contained in:
@@ -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);
|
||||
|
@@ -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();
|
||||
|
Reference in New Issue
Block a user