[BUGFIX] Exclude empty passwords from password hashing check 35/23435/2
authorNicole Cordes <typo3@cordes.co>
Wed, 28 Aug 2013 14:02:36 +0000 (16:02 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 28 Aug 2013 19:58:00 +0000 (21:58 +0200)
The test for insecure passwords handles empty passwords as insecure and
recommends to use the saltedpasswords scheduler task to convert all
insecure passwords. But the scheduler task doesn't convert empty
passwords, so a never ending story exists. Therefore this patch exludes
empty passwords being handled as insecure.

Resolves: #36244
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: I6bdd5c8807a07841850c1e4c22afe57eec28b335
Reviewed-on: https://review.typo3.org/23435
Reviewed-by: Kay Strobach
Tested-by: Kay Strobach
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/saltedpasswords/classes/class.tx_saltedpasswords_div.php

index 356fb80..956021c 100644 (file)
@@ -59,7 +59,8 @@ class tx_saltedpasswords_div {
                        $userCount = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
                                '*',
                                'be_users',
-                               'password NOT LIKE ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('$%', 'be_users')
+                               'password != ""'
+                                       . ' AND password NOT LIKE ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('$%', 'be_users')
                                        . ' AND password NOT LIKE ' . $GLOBALS['TYPO3_DB']->fullQuoteStr('M$%', 'be_users')
                        );
                        return $userCount;
@@ -162,4 +163,4 @@ class tx_saltedpasswords_div {
                }
 }
 
-?>
\ No newline at end of file
+?>