Skip to content

Password change failes on multibyte strings #38

Description

@ringej

The encodePassword() functions failes on multibyte strings like utf-8 passwords with german umlauts (ä,ö,ü,ß, etc.) because the functions just adds zerobytes after every character which ends up in invalid utf-16le.

I replaced the original function:

public function encodePassword($password)
{
$password=""".$password.""";
$encoded="";
for ($i=0; $i <strlen($password); $i++){ $encoded.="{$password{$i}}\000"; }
return $encoded;
}

with this:

public function encodePassword($password)
{
$encoded = mb_convert_encoding('"' . $password . '"', 'utf-16le', 'utf-8');
return $encoded;
}

this worked for me.

have a nice day, johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions