Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 399 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 399 Revision 991
Zeile 57... Zeile 57...
57
     *
57
     *
58
     * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet
58
     * @return bool Whether the request IP matches the IP, or whether the request IP is within the CIDR subnet
59
     */
59
     */
60
    public static function checkIp4(string $requestIp, string $ip): bool
60
    public static function checkIp4(string $requestIp, string $ip): bool
61
    {
61
    {
62
        $cacheKey = $requestIp.'-'.$ip;
62
        $cacheKey = $requestIp.'-'.$ip.'-v4';
63
        if (isset(self::$checkedIps[$cacheKey])) {
63
        if (isset(self::$checkedIps[$cacheKey])) {
64
            return self::$checkedIps[$cacheKey];
64
            return self::$checkedIps[$cacheKey];
65
        }
65
        }
Zeile 66... Zeile 66...
66
 
66
 
Zeile 102... Zeile 102...
102
     *
102
     *
103
     * @throws \RuntimeException When IPV6 support is not enabled
103
     * @throws \RuntimeException When IPV6 support is not enabled
104
     */
104
     */
105
    public static function checkIp6(string $requestIp, string $ip): bool
105
    public static function checkIp6(string $requestIp, string $ip): bool
106
    {
106
    {
107
        $cacheKey = $requestIp.'-'.$ip;
107
        $cacheKey = $requestIp.'-'.$ip.'-v6';
108
        if (isset(self::$checkedIps[$cacheKey])) {
108
        if (isset(self::$checkedIps[$cacheKey])) {
109
            return self::$checkedIps[$cacheKey];
109
            return self::$checkedIps[$cacheKey];
110
        }
110
        }
Zeile 111... Zeile 111...
111
 
111