View Site News

Trim whitespaces

Posted on: Sep 8th 2006 | Posted by: Rolan |

I was so conscious of properly sanitizing user input with htmlspecialchars() and addslashes() that sometimes I forget to trim() them for whitespaces. A small application I’m currently doing with CakePHP had this kind of bug related to unwanted whitespaces. It took me sometime to spot it.

Filed in: PHP,Reminders |

Trackback URI | Comments RSS

Leave a Reply