[SECURITY] Fix CSRF, XSS and code injection vulnerability.

This commit fixes the following security issues:
  * a CSRF vulnerability when creating new topics and posts
  * a code injection vulnerability in the attachment funcionality.
  * a XSS vulnerability when displaying the user profile.

Change-Id: Icc80d88981621cb32195e334f9b832782473b21e
Reviewed-on: https://review.typo3.org/27630
Reviewed-by: Simon Schaufelberger
Tested-by: Simon Schaufelberger