diff --git a/inc/auth.php b/inc/auth.php
index 3966a4d47ebfc5c1335e67452f75e104076148b4..87b5f80ee79d9dc9554d416ef1767d0ae7c0a16c 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':