mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-16 00:08:53 +00: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:
parent
ab068799b1
commit
16e5d0dc35
1 changed files with 3 additions and 2 deletions
|
@ -55,7 +55,8 @@ class phpbb_crypto_helper
|
||||||
{
|
{
|
||||||
preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match);
|
preg_match('#^\$([a-zA-Z0-9\\\]*?)\$#', $hash, $match);
|
||||||
$hash_settings = substr($hash, strpos($hash, $match[1]) + strlen($match[1]) + 1);
|
$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, '$');
|
$dollar_position = strpos($hash_settings, '$');
|
||||||
$output[] = substr($hash_settings, 0, ($dollar_position != false) ? $dollar_position : strlen($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')
|
if ($type == 'prefix')
|
||||||
{
|
{
|
||||||
$data[$type] .= ($data[$type] !== '$') ? '\\' : '';
|
$data[$type] .= ($data[$type] !== '$') ? '\\' : '';
|
||||||
$data[$type] .= $value;
|
$data[$type] .= str_replace('$', '', $value);
|
||||||
}
|
}
|
||||||
elseif ($type == 'settings')
|
elseif ($type == 'settings')
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue