Browse Source

fixed isEncrypted function to work with any style of password (#1826)

CauseFX 4 years ago
parent
commit
f2eb9485e5
1 changed files with 3 additions and 14 deletions
  1. 3 14
      api/functions/normal-functions.php

+ 3 - 14
api/functions/normal-functions.php

@@ -222,20 +222,9 @@ trait NormalFunctions
 		return $tmp;
 		return $tmp;
 	}
 	}
 
 
-	public function isEncrypted($password)
-	{
-		switch (strlen($password)) {
-			case '24':
-			case '88':
-				return strpos($password, '==') !== false;
-			case '44':
-			case '108':
-				return substr($password, -1, 1) == '=';
-			case '64':
-				return true;
-			default:
-				return false;
-		}
+	public function isEncrypted($password = null)
+	{
+		return ($password == null || $password == '') ? false : $this->decrypt($password);
 	}
 	}
 
 
 	public function fillString($string, $length)
 	public function fillString($string, $length)