CodeIgniter Forums
Auto decodeing htmlspecialhars on output. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Auto decodeing htmlspecialhars on output. (/showthread.php?tid=63225)



Auto decodeing htmlspecialhars on output. - Anime_Life - 10-08-2015

The CI db library automatically converts my data into htmlspecialchars. I want it to be automatically decoded during output. Is it possible? I don't want to end up changing every $row->value to htmlspecialchars_decode($row->value).


RE: Auto decodeing htmlspecialhars on output. - Narf - 10-09-2015

The CI db library doesn't do what you're saying it does.


RE: Auto decodeing htmlspecialhars on output. - Anime_Life - 10-09-2015

(10-09-2015, 02:20 AM)Narf Wrote: The CI db library doesn't do what you're saying it does.

It converts all my input and automatically converts it to html special chars if I user insert or update method of db library.
On https://www.codeigniter.com/userguide3/database/query_builder.html, it says


Quote:It also allows for safer queries, since the values are escaped automatically by the system.

So if I use these methods and have a look at my db it is converting it to htmlspecialchars to escape properly.
What I want is somehow these htmlspecialchars should be converted back to normal text while retrieving back.

Thanks in advance


RE: Auto decodeing htmlspecialhars on output. - Anime_Life - 10-09-2015

Sorry, for all the trouble. I was using set_value() to get the values. I did not know that it was converting input into htmlspecialchars. Now switching back to input->post() fixed things