php脚本输出原始HTML但仅在编辑后输出

i'm working on a php forum script not my own.

the forum's index page displays the topic's title and description.

i set the topic description to equal the topic's body(the actual post text), so when the topic gets posted the body gets inserted into the description field and it displays as expected, in other words, the html renders in the description area. then i click on the edit buttton for the topic which allows the title and description to be edited. regular HTML for the description is present, i click save. the html gets inserted into the DB as regular HTML. the index page now displays the raw html instead of rendering it as it did before.

i can't figure out why it would render the first time but not after it passes through the edit code even though nothing is changed and the html is not being replaced or stripped.

i need some help and clues on what to look for and research. i've covered htmlspecialchar, strip tags and some preg replace but i'm not getting anywhere. even if i just get a clue in the right direction.

thank you much.

the answer is i needed to add the function htmlspecialchars_decode to the relevant string.