]> git.mxchange.org Git - mailer.git/commitdiff
Some fixes for password scrambling.
authorRoland Haeder <roland@mxchange.org>
Fri, 18 Apr 2014 15:37:41 +0000 (17:37 +0200)
committerRoland Haeder <roland@mxchange.org>
Fri, 18 Apr 2014 15:37:41 +0000 (17:37 +0200)
Signed-off-by: Roland Häder <roland@mxchange.org>
inc/functions.php

index f55c9a396a70d70b13db32e2ce2794b95f016a56..a5a92f5ecfbdefd42ee0cd601595e16afbe1a21c 100644 (file)
@@ -832,14 +832,17 @@ function scrambleString ($str) {
        if (strlen($str) > 40) {
                // The string is to long
                return $str;
-       } elseif (strlen($str) == 40) {
+       } elseif ((strlen($str) == 40) && (getPassScramble() != '')) {
                // From database
-               $scrambleNums = explode(':', getPassScramble());
+               $scramble = getPassScramble();
        } else {
                // Generate new numbers
-               $scrambleNums = explode(':', genScrambleString(strlen($str)));
+               $scramble = genScrambleString(strlen($str));
        }
 
+       // Convert it into an array
+       $scrambleNums = explode(':', $scramble);
+
        // Assert on both lengths
        assert(strlen($str) == count($scrambleNums));