public function verify($password, $hash)
	{
		// Check if the hash is a blowfish hash.
		if (substr($hash, 0, 4) == '$2a$' || substr($hash, 0, 4) == '$2y$')
		{
			if (version_compare(PHP_VERSION, '5.3.7') >= 0)
			{
				$type = '$2y$';
			}
			else
			{
				$type = '$2a$';
			}

			$hash = $type . substr($hash, 4);

			return (crypt($password, $hash) === $hash);
		}

		// Check if the hash is an MD5 hash.
		if (substr($hash, 0, 3) == '$1$')
		{
			return (crypt($password, $hash) === $hash);
		}

		// Check if the hash is a Joomla hash.
		if (preg_match('#[a-z0-9]{32}:[A-Za-z0-9]{32}#', $hash) === 1)
		{
			return md5($password . substr($hash, 33)) == substr($hash, 0, 32);
		}

		return false;
	}
public function verify($password, $hash)
	{
		// Check if the hash is a blowfish hash.
		if (substr($hash, 0, 4) == '$2a$' || substr($hash, 0, 4) == '$2y$')
		{
			if (version_compare(PHP_VERSION, '5.3.7') >= 0)
			{
				$type = '$2y$';
			}
			else
			{
				$type = '$2a$';
			}

			$hash = $type . substr($hash, 4);

			return (crypt($password, $hash) === $hash);
		}

		// Check if the hash is an MD5 hash.
		if (substr($hash, 0, 3) == '$1$')
		{
			return (crypt($password, $hash) === $hash);
		}

		// Check if the hash is a Joomla hash.
		if (preg_match('#[a-z0-9]{32}:[A-Za-z0-9]{32}#', $hash) === 1)
		{
			return md5($password . substr($hash, 33)) == substr($hash, 0, 32);
		}

		return false;
	}
public function verify ( $ password , $ hash ) { // Check if the hash is a blowfish hash. if ( substr ( $ hash , 0 , 4 ) == '$2a$' || substr ( $ hash , 0 , 4 ) == '$2y$' ) { if ( version_compare ( PHP_VERSION , '5.3.7' ) >= 0 ) { $ type = '$2y$' ; } else { $ type = '$2a$' ; } $ hash = $ type . substr ( $ hash , 4 ) ; return ( crypt ( $ password , $ hash ) === $ hash ) ; } // Check if the hash is an MD5 hash. if ( substr ( $ hash , 0 , 3 ) == '$1$' ) { return ( crypt ( $ password , $ hash ) === $ hash ) ; } // Check if the hash is a Joomla hash. if ( preg_match ( '#[a-z0-9]{32}:[A-Za-z0-9]{32}#' , $ hash ) === 1 ) { return md5 ( $ password . substr ( $ hash , 33 ) ) == substr ( $ hash , 0 , 32 ) ; } return false ; }
Verifies a password hash

@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.

@since   1.0
Verifies a password hash