From 056cb2ccb4da10b9edc056f5ad283299f4524416 Mon Sep 17 00:00:00 2001
From: Chris Smith <chris.eureka@jalakai.co.uk>
Date: Mon, 13 Oct 2008 14:34:17 +0200
Subject: [PATCH] Ensure 'smd5' password hashing method is only triggered when
 available

darcs-hash:20081013123417-f07c6-eaa5586edad17a971f4daf38afac77c6946539f0.gz
---
 inc/auth.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/inc/auth.php b/inc/auth.php
index 3966a4d47..87b5f80ee 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -861,7 +861,7 @@ function auth_cryptPassword($clear,$method='',$salt=null){
 
     switch(strtolower($method)){
         case 'smd5':
-            if(defined('CRYPT_MD5')) return crypt($clear,'$1$'.substr($salt,0,8).'$');
+            if(defined('CRYPT_MD5') && CRYPT_MD5) return crypt($clear,'$1$'.substr($salt,0,8).'$');
             // when crypt can't handle SMD5, falls through to pure PHP implementation
             $magic = '1';
         case 'apr1':
-- 
GitLab