[support] delete leading and trailing spaces from user input (on title, etc.)

Benjamin Jacob ben4asterisk at yahoo.com
Thu Feb 25 15:00:15 UTC 2010


Hi All,

I tried to google this but found all php and C++ tricks to trim leading and trailing spaces from a given string, which I already knew of (for a change).

In drupal I tried adding a new CCK node with a title having quite a few spaces at the start, in between words and at the end as well.

As expected the visible output is nicely trimmed, but the variable value itself stored contains exactly how I entered it (with spaces and all). How do I store the desired trimmed data into my database?

Regards
- Ben


      


More information about the support mailing list