Browse Source

Allow for SCRAM Algorithms with Hyphens

Andy 4 years ago
parent
commit
a11875145c
1 changed files with 4 additions and 1 deletions
  1. 4 1
      functions/auth.php

+ 4 - 1
functions/auth.php

@@ -153,7 +153,10 @@ function scram_supports($algo) {
   $HMACs = hash_hmac_algos();
   $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))
   return $fAlgo;
  return false;