Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian MacLennan committed Aug 20, 2012
1 parent be4b42a commit fce7e02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions libraries/joomla/crypt/password.php
Expand Up @@ -41,8 +41,8 @@ public function create($password, $prefix = '$2a$');
/**
* Verifies a password hash
*
* @param string $password The password to verify.
* @param string $hash The password hash to check.
* @param string $password The password to verify.
* @param string $hash The password hash to check.
*
* @return boolean True if the password is valid, false otherwise.
*
Expand Down
19 changes: 8 additions & 11 deletions libraries/joomla/crypt/password/simple.php
Expand Up @@ -28,7 +28,7 @@ class JCryptPasswordSimple implements JCryptPassword
* Creates a password hash
*
* @param string $password The password to hash.
* @param string $prefix The prefix of the hashing function.
* @param string $type The hash type.
*
* @return string The hashed password.
*
Expand All @@ -52,22 +52,19 @@ public function create($password, $type = JCryptPassword::BLOWFISH)

$salt = $prefix . str_pad($this->cost, 2, '0', STR_PAD_LEFT) . '$' . $this->getSalt(22);

return crypt($password, $salt);
break;
return crypt($password, $salt);

case JCryptPassword::MD5:
$salt = $this->getSalt(12);

$salt = '$1$' . $salt;

return crypt($password, $salt);
break;

return crypt($password, $salt);

case JCryptPassword::JOOMLA:
$salt = $this->getSalt(32);

return md5($password . $salt) . ':' . $salt;
break;
return md5($password . $salt) . ':' . $salt;

default:
throw new InvalidArgumentException(sprintf('Hash type %s is not supported', $type));
Expand All @@ -94,7 +91,7 @@ public function setCost($cost)
*
* @param integer $length The number of characters to return.
*
* @return string The string of random characters.
* @return string The string of random characters.
*
* @since 12.2
*/
Expand All @@ -110,8 +107,8 @@ protected function getSalt($length)
/**
* Verifies a password hash
*
* @param string $password The password to verify.
* @param string $hash The password hash to check.
* @param string $password The password to verify.
* @param string $hash The password hash to check.
*
* @return boolean True if the password is valid, false otherwise.
*
Expand Down

0 comments on commit fce7e02

Please sign in to comment.