Prevent SQL injection

git-svn-id: http://chianti.ucsd.edu/svn@31178 0ecc0d97-ab19-0410-9704-bfe1a75892f5