title: How to escape/strip special characters in the LaTeX document?
body: <p>We implemented the online service where it is possible to generate PDF with predefined 
  structure. The user can choose a LaTeX template and then compile it with an appropriate inputs.</p>
  
  <p>The question we worry about is the security, that the malicious user was not able to gain shell access through the injection of special instruction into latex document.</p>
  
  <p><strong>We need some workaround for this or at least a list of special characters that we should strip from the input data.</strong></p>
  
  <p>Preferred language would be PHP, but any suggestions, constructions and links are very welcomed.</p>
  
  <p>PS. in few word we're looking for <strong>mysql_real_escape_string</strong> for LaTeX</p>