1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-10 16:35:35 +02:00

[feature/passwords] Fix minor code limitations in helper

These limitations caused it to only allow a specific input to combined
hashes.

PHPBB3-11610
This commit is contained in:
Marc Alexander
2013-06-27 14:25:50 +02:00
parent ab068799b1
commit 16e5d0dc35

View File

@ -55,7 +55,8 @@ class phpbb_crypto_helper
{
preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match);
$hash_settings = substr($hash, strpos($hash, $match[1]) + strlen($match[1]) + 1);
foreach ($match as $cur_type)
$matches = explode('\\', $match[1]);
foreach ($matches as $cur_type)
{
$dollar_position = strpos($hash_settings, '$');
$output[] = substr($hash_settings, 0, ($dollar_position != false) ? $dollar_position : strlen($hash_settings));
@ -112,7 +113,7 @@ class phpbb_crypto_helper
if ($type == 'prefix')
{
$data[$type] .= ($data[$type] !== '$') ? '\\' : '';
$data[$type] .= $value;
$data[$type] .= str_replace('$', '', $value);
}
elseif ($type == 'settings')
{