Explorar o código

Allow for SCRAM Algorithms with Hyphens

Andy %!s(int64=4) %!d(string=hai) anos
pai
achega
a11875145c
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      functions/auth.php

+ 4 - 1
functions/auth.php

@@ -153,7 +153,10 @@ function scram_supports($algo) {
   $HMACs = hash_hmac_algos();
   $HMACs = hash_hmac_algos();
   $HASHs = array_values(array_intersect($HASHs, $HMACs));
   $HASHs = array_values(array_intersect($HASHs, $HMACs));
  }
  }
- $fAlgo = strtolower(str_replace('-', '', $algo));
+ $fAlgo = strtolower($algo);
+ if (in_array($fAlgo, $HASHs))
+  return $fAlgo;
+ $fAlgo = str_replace('-', '', $fAlgo);
  if (in_array($fAlgo, $HASHs))
  if (in_array($fAlgo, $HASHs))
   return $fAlgo;
   return $fAlgo;
  return false;
  return false;