Replace php trim method with JFilterInput TRIM filter 

Replace php trim method with JFilterInput TRIM filter to deal with non-breaking and multibyte spaces