jgd1234567
Programmer
Hi, i'm trying to make my website more secure by encoding any output i display. However i still want to allow some html tags.
I am using a wysiwyg editor with only bold, italic and underline enabled. I enter my text in the wysiwyg and click submit, the data is then inserted into the database without encoding. I then html encode the text as i display it and replace any occurances of <b> to <b> etc to allow the specific html tags. The problem i have though is that the wysiwyg encodes certain characters (ie <) but then i encode them and suddenly instead of display as < it displays as <.
I was wondering if anyone knows a way i could do this. Appreciate your help.
I am using a wysiwyg editor with only bold, italic and underline enabled. I enter my text in the wysiwyg and click submit, the data is then inserted into the database without encoding. I then html encode the text as i display it and replace any occurances of <b> to <b> etc to allow the specific html tags. The problem i have though is that the wysiwyg encodes certain characters (ie <) but then i encode them and suddenly instead of display as < it displays as <.
I was wondering if anyone knows a way i could do this. Appreciate your help.