-
You should not worry at all about input sanitization, Doctrine is immune to sql injection
-
By default, all output is escaped. So even if $text has script tags, it will be escaped; visible as text but not executed by browser. And if you want to have http://example.com clickable, there are jquery plugins that can do that for you.
-
I would only put validation, there is
new Symfony\Component\Validator\Constraints\Url() ;
available for you