paul wrote:
In my rails apps do I need to do mysql_escape and if so what functions are around to be able to do this?
Let Rails take care of all such mundane things for you. Either assign your string, as string data, to a member of an ActiveRecord-derived object, or use your string in a find() using a parameter substitution system, like :conditions => ['foo = ?', my_foo].
I suspect Rails will either correctly escape things, or will use the underlying Database's parameterized query system.
All you need to do is remember never to put a tainted string directly into a fragment of an SQL statement. Never say, for example, :conditions => "foo = '#{my_foo}'", because now you are vulnerable to SQL-insertion attacks. Rails cannot help a string with #{} in it, because that expands at Ruby time before Rails sees the string.