Using create_function to create anonymous function

Earlier it directly created anonymous function which were unsupported in
PHP 5.2
Using a function to sanitize ticket reply

This is to increase code reuse