[Mono-list] magic quotes (like PHP)

A Rafael D Teixeira rafael.teixeirabr@terra.com.br
Fri, 08 Apr 2005 16:25:20 -0300

On Thu, 2005-04-07 at 12:06 -0400, James Grant wrote:
> Hi there, 

Hi James,

>  I'm running into an issue with an application that has been ported over from 
> windows to linux/mono.  On windows, you could enter apostrophe's in input 
> boxes which are then stored in the database without any problems, but on mono 
> it seems that the apostrophe's all need to be manually escaped on every 
> query.

You are mixing things: that is surely note a windows x mono issue.
Quotes in general aren't changed in any form by input boxes, or string
handling. What may possibly mess with them is the ADO.NET provider when
writing the string to the database, as it may have to escape the quotes
as needed, and the particular one you are using may not be doing that
correctly. Or you may be fooling it by hand-constructing SQL commands or
setting incorrect parameter definitions.

First answer these:

To what database are you connecting? What ADO.NET provider are you
using, in Windows with .NET and elsewhere with Mono? Are you using
correctly parameterized queries?

Answering that we can find the real culprit for mishandling the
quotation marks.

> I know PHP has an option for "magic quotes"
> 	http://ca.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime
> and was wondering if mono had a similar configuration option?  

No need for such a hack...