Skip to content

Commit

Permalink
Check that constants are not empty before returning values
Browse files Browse the repository at this point in the history
  • Loading branch information
joeles committed Feb 11, 2021
1 parent 951ca5a commit 0dfcb5f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/WordPress/DataStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getHostAPIUserUniqueId()
*/
public function getClientV4APIKey()
{
if (defined('CLOUDFLARE_API_KEY')) {
if (defined('CLOUDFLARE_API_KEY') && CLOUDFLARE_API_KEY !== '') {
return CLOUDFLARE_API_KEY;
}

Expand All @@ -87,7 +87,7 @@ public function getHostAPIUserKey()
*/
public function getDomainNameCache()
{
if (defined('CLOUDFLARE_DOMAIN_NAME')) {
if (defined('CLOUDFLARE_DOMAIN_NAME') && CLOUDFLARE_DOMAIN_NAME !== '') {
return CLOUDFLARE_DOMAIN_NAME;
}

Expand All @@ -104,7 +104,7 @@ public function getDomainNameCache()
*/
public function setDomainNameCache($domainName)
{
if (defined('CLOUDFLARE_DOMAIN_NAME')) {
if (defined('CLOUDFLARE_DOMAIN_NAME') && CLOUDFLARE_DOMAIN_NAME !== '') {
return;
}

Expand All @@ -116,7 +116,7 @@ public function setDomainNameCache($domainName)
*/
public function getCloudFlareEmail()
{
if (defined('CLOUDFLARE_EMAIL')) {
if (defined('CLOUDFLARE_EMAIL') && CLOUDFLARE_EMAIL !== '') {
return CLOUDFLARE_EMAIL;
}

Expand Down

0 comments on commit 0dfcb5f

Please sign in to comment.