Fixed password check
authorMarcel Werk <burntime@woltlab.com>
Fri, 16 Aug 2013 23:02:06 +0000 (01:02 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 16 Aug 2013 23:02:06 +0000 (01:02 +0200)
wcfsetup/install/files/lib/util/PasswordUtil.class.php

index 287df62f4eb06a07a133289b6a62b5e89f4938b0..6591c46f1c5a9d892e4baf0de637f0c5c6e6e870 100644 (file)
@@ -104,13 +104,13 @@ final class PasswordUtil {
                }
                
                // drop type from hash
-               $dbHash = substr($dbHash, strlen($type));
+               $dbHash = substr($dbHash, strlen($type) + 1);
                
                // check for salt
                $salt = '';
                if (($pos = strrpos($dbHash, ':')) !== false) {
                        $salt = substr(substr($dbHash, $pos), 1);
-                       $dbHash = substr($dbHash, 1, ($pos - 1));
+                       $dbHash = substr($dbHash, 0, $pos);
                }
                
                // compare hash