Re: Single quotes in ajax POST data getting prefixed with backslash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That is a PHP configuration option called Magic Quotes ( http://www.php.net/manual/en/info.configuration.php#ini.magic-quotes-gpc) that used to be on by default and is now off by default in recent PHP releases.

- Y

Sent from a gizmo with a very small keyboard and hyperactive autocorrect.

On Dec 9, 2013 4:57 PM, "Tim Streater" <tim@xxxxxxxxxxxxxxxx> wrote:
I run an instance of apache under OS X which I use to pass data to PHP scripts using ajax. If I have a string such as "O'Toole" (without the double-quotes), then when the string (which I pass through encodeURIComponent in the browser) arrives in the PHP script, the single-quote is prefixed with a backslash. That is, the string above becomes "O\'Toole".

I want my app to run under Win7, and I observe that there, the backslash is *not* inserted. This difference is a bit irritating, especially as I am having trouble discovering which component (browser, apache, PHP) is adding the backslash. On the whole, I'd rather not have it, but I'd settle for both platforms adding it. Then at least code common to both platforms can remove it.

Any guidance as to where to look would be appreciated.

--
Cheers  --  Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux