- Updates MailChimp API key regex
This commit is contained in:
@@ -8,7 +8,7 @@ class MailChimp {
|
|||||||
public $max_post_size;
|
public $max_post_size;
|
||||||
public $data_center;
|
public $data_center;
|
||||||
public $export_url;
|
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) {
|
function __construct($api_key, $lists = false) {
|
||||||
$this->api_key = $this->getAPIKey($api_key);
|
$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,
|
// the first part of the key must contain 32 characters,
|
||||||
expect($this->mailchimp->getAPIKey('1234567890123456789012345678901-123'))
|
expect($this->mailchimp->getAPIKey('1234567890123456789012345678901-123'))
|
||||||
->false();
|
->false();
|
||||||
// the second part must contain 2 or 3 characters
|
// the second part must contain 2-4 characters
|
||||||
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-1234'))
|
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-12345'))
|
||||||
->false();
|
->false();
|
||||||
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-1'))
|
expect($this->mailchimp->getAPIKey('12345678901234567890123456789012-1'))
|
||||||
->false();
|
->false();
|
||||||
|
Reference in New Issue
Block a user