# ivyforms/0.3.1/backend/src/Repository/Entry/EntryRequestHelper.php

The Innovative Form Builder – IvyForms, version 0.3.1. 62 lines.

- Page: https://pluginprobe.com/plugins/ivyforms/0.3.1/code/backend/src/Repository/Entry/EntryRequestHelper.php
- Raw: https://pluginprobe.com/plugins/ivyforms/0.3.1/raw/backend/src/Repository/Entry/EntryRequestHelper.php
- Modified: 2025-09-04T07:37:14+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/ivyforms/0.3.1/code/backend/src/Repository/Entry/EntryRequestHelper.php#L10-L20`.

```php
<?php

namespace IvyForms\Repository\Entry;

class EntryRequestHelper
{
    /**
     * Get the client IP address.
     *
     * @return string|null
     */
    public static function getClientIpAddress(): ?string
    {
        $ip = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
        return $ip ?: null;
    }

    /**
     * Get the user agent string.
     *
     * @return string
     */
    public static function getUserAgent(): string
    {
        $userAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT');
        return $userAgent ?: '';
    }

    /**
     * Get the source URL.
     *
     * @return string|null
     */
    public static function getSourceURL(): ?string
    {
        $sourceURL = filter_input(INPUT_SERVER, 'HTTP_REFERER');
        return $sourceURL ?: '';
    }

    /**
     * Get the browser name from the user agent string.
     *
     * @param string $userAgent
     * @return string
     */
    public static function getBrowserName(string $userAgent): string
    {
        if (str_contains($userAgent, 'Firefox')) {
            return 'Mozilla Firefox';
        } elseif (str_contains($userAgent, 'Chrome') && !str_contains($userAgent, 'Edg')) {
            return 'Google Chrome';
        } elseif (str_contains($userAgent, 'Safari') && !str_contains($userAgent, 'Chrome')) {
            return 'Apple Safari';
        } elseif (str_contains($userAgent, 'Edg')) {
            return 'Microsoft Edge';
        } elseif (str_contains($userAgent, 'MSIE') || str_contains($userAgent, 'Trident')) {
            return 'Internet Explorer';
        }
        return 'Unknown';
    }
}

```
