Skip to content
Snippets Groups Projects
Commit 602a5a87 authored by Apparao G's avatar Apparao G
Browse files

#157831827::Unable to create the new role,showing 500 error

See merge request !933
parents 46b11f51 67b9fb3b
No related branches found
No related tags found
1 merge request!933157831827::Unable to create the new role,showing 500 error
......@@ -709,7 +709,7 @@ function vtlib_purify($input, $ignore = false) {
if (is_array($input)) {
$value = array();
foreach ($input as $k => $v) {
$value[$k] = str_replace('&', '&', vtlib_purify($v, $ignore));
$value[$k] = vtlib_purify($v, $ignore);
}
} else { // Simple type
$value = $__htmlpurifier_instance->purify($input);
......@@ -717,12 +717,27 @@ function vtlib_purify($input, $ignore = false) {
}
}
$purified_cache[$md5OfInput] = $value;
}
if(is_array($value)) {
$value = str_replace_json('&', '&', $value);
} else {
$value = str_replace('&', '&', $value);
}
return $value;
}
/**
* Function to replace values in multi dimentional array (str_replace will support only one level of array)
* @param type $search
* @param type $replace
* @param type $subject
* @return <array>
*/
function str_replace_json($search, $replace, $subject){
return json_decode(str_replace($search, $replace, json_encode($subject)), true);
}
/**
* To purify malicious html event attributes
* @param <String> $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