# give/4.15.3/src/DonationSpam/EmailAddressWhiteList.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.15.3. 32 lines.

- Page: https://pluginprobe.com/plugins/give/4.15.3/code/src/DonationSpam/EmailAddressWhiteList.php
- Raw: https://pluginprobe.com/plugins/give/4.15.3/raw/src/DonationSpam/EmailAddressWhiteList.php
- Modified: 2024-08-22T21:00:34+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.15.3/code/src/DonationSpam/EmailAddressWhiteList.php#L10-L20`.

```php
<?php

namespace Give\DonationSpam;

/**
 * @since 3.15.0
 */
class EmailAddressWhiteList
{
    /**
     * @var array
     */
    protected $whitelistEmails;

    /**
     * @since 3.15.1 Add array type to enforce type.
     * @since 3.15.0
     */
    public function __construct(array $whitelistEmails = [])
    {
        $this->whitelistEmails = $whitelistEmails;
    }

    /**
     * @since 3.15.0
     */
    public function validate($email): bool
    {
        return in_array($email, $this->whitelistEmails, true);
    }
}

```
