Skip to content

Commit 5410eab

Browse files
lfbittencourtrichleland
authored andcommitted
Update key validation
Fixes #75
1 parent 34a4ae3 commit 5410eab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SparkPost/SparkPost.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function setConfig($settingsConfig) {
115115
}
116116

117117
// Validate API key because its required
118-
if (!isset($settingsConfig['key']) || empty(trim($settingsConfig['key']))){
118+
if (!isset($settingsConfig['key']) || !preg_match('/\S/', $settingsConfig['key'])){
119119
throw new \Exception('You must provide an API key');
120120
}
121121

0 commit comments

Comments
 (0)