[ticket/12641] Use jQuery's trim() method. IE8 does not support the native one.

https://tracker.phpbb.com/browse/PHPBB3-12641