Explorar o código

only check for blacklisted ip if not blank

CauseFX %!s(int64=4) %!d(string=hai) anos
pai
achega
00a0f2b5c9
Modificáronse 2 ficheiros con 6 adicións e 2 borrados
  1. 4 2
      api/classes/organizr.class.php
  2. 2 0
      api/functions/option-functions.php

+ 4 - 2
api/classes/organizr.class.php

@@ -186,8 +186,10 @@ class Organizr
 	{
 		if ($this->hasDB()) {
 			$currentIP = $this->userIP();
-			if (in_array($currentIP, $this->arrayIP($this->config['blacklisted']))) {
-				die($this->config['blacklistedMessage']);
+			if ($this->config['blacklisted'] !== '') {
+				if (in_array($currentIP, $this->arrayIP($this->config['blacklisted']))) {
+					die($this->config['blacklistedMessage']);
+				}
 			}
 		}
 	}

+ 2 - 0
api/functions/option-functions.php

@@ -13,6 +13,8 @@ trait OptionsFunction
 					'value' => $item
 				];
 			}
+		} elseif ($values == '') {
+			$formattedValues = '';
 		} else {
 			$formattedValues[] = [
 				'name' => $values,