Replace calls to htmlspecialchars() with sm_encode_html_special_chars().