summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/user_ldap/lib/Mapping/AbstractMapping.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Mapping/AbstractMapping.php b/apps/user_ldap/lib/Mapping/AbstractMapping.php
index 18b76a0bf15..aea40c577b6 100644
--- a/apps/user_ldap/lib/Mapping/AbstractMapping.php
+++ b/apps/user_ldap/lib/Mapping/AbstractMapping.php
@@ -191,7 +191,12 @@ abstract class AbstractMapping {
* Get the hash to store in database column ldap_dn_hash for a given dn
*/
protected function getDNHash(string $fdn): string {
- return (string)hash('sha256', $fdn, false);
+ $hash = hash('sha256', $fdn, false);
+ if (is_string($hash)) {
+ return $hash;
+ } else {
+ throw new \RuntimeException('hash function did not return a string');
+ }
}
/**