Skip to content
Snippets Groups Projects
Commit bafc6444 authored by Prasad's avatar Prasad
Browse files

Merge branch '152726006' into 'master'

#152726006::Amit::Upgrade - Weak Hashing Algorithm in VtlibUtils.php

See merge request !861
parents 6eaf8716 bbb7eb07
No related branches found
No related tags found
No related merge requests found
......@@ -666,9 +666,9 @@ function vtlib_purify($input, $ignore = false) {
$value = $input;
if (!is_array($input)) {
$md5OfInput = md5($input);
if (array_key_exists($md5OfInput, $purified_cache)) {
$value = $purified_cache[$md5OfInput];
$encryptInput = hash('sha256',$input);
if (array_key_exists($encryptInput, $purified_cache)) {
$value = $purified_cache[$encryptInput];
//to escape cleaning up again
$ignore = true;
}
......@@ -718,7 +718,7 @@ function vtlib_purify($input, $ignore = false) {
$value = purifyHtmlEventAttributes($value, true);
}
}
$purified_cache[$md5OfInput] = $value;
$purified_cache[$encryptInput] = $value;
}
$value = str_replace('&', '&', $value);
return $value;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment