Here is how you can get this function in php < 5.1, just make sure this function is before you try and call the function.
if (!function_exists('htmlspecialchars_decode')) {
function htmlspecialchars_decode($str, $options="") {
$trans = get_html_translation_table(HTML_SPECIALCHARS, $options);
$decode = ARRAY();
foreach ($trans AS $char=>$entity) {
$decode[$entity] = $char;
}
$str = strtr($str, $decode);
return $str;
}
}