public static function is_trusted_client($ip) { if (!defined('TRUSTED_CLIENTS')) { return false; } // pack string in array $trusted = explode(',', TRUSTED_CLIENTS); foreach ($trusted as $mask) { if (MpUtils::check_netmask(trim($mask), $ip)) { return true; } } return false; }