Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 670CA10D5C for ; Mon, 9 Dec 2013 22:31:28 +0000 (UTC) Received: (qmail 56937 invoked by uid 500); 9 Dec 2013 22:31:25 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 56910 invoked by uid 500); 9 Dec 2013 22:31:25 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 56902 invoked by uid 99); 9 Dec 2013 22:31:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:31:25 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of yehuda@ymkatz.net designates 209.85.216.50 as permitted sender) Received: from [209.85.216.50] (HELO mail-qa0-f50.google.com) (209.85.216.50) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Dec 2013 22:31:21 +0000 Received: by mail-qa0-f50.google.com with SMTP id i13so3138687qae.9 for ; Mon, 09 Dec 2013 14:31:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:dkim-signature:mime-version:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=XlCGSML6mJK096BP0cNJ6wUDxFnAnseRPop7H69eB0w=; b=ThIisdOkD3MAl6OdQbLTXzBCMuJETHCHRxqW1IDVh2idtU+SUNjo6CI/pRvITi1UNT tQE94rLAUSkLBDyypIQsgLV524XaR2edcp4pQekCOiHESu52AOJAsFtOhnjsgnucf5KU 2emEqtZ1I/Jn6Q8OKi0NdGUbXfjle8qAJuCQ8mDo3JglOn47GnUlT74+YmvtCSdd21ix 3rH+6w5aBkRKvxwCVx07iVfxDQqvBFHoTy+ifKRMdjvz8oQaUyN+WRccmJ//cE2gvm+h j1VDAouUF5em6H7Lmo91+dehAlvrxOtlRdq5mw7Tr0lSTAecbYitoK9sN4rwdcfurMMR NNSw== X-Gm-Message-State: ALoCoQlgArRpnHRF5ws13zHA1S7v/ArimjvsadsqcWlH5iB9Znyhsg3x4TmkJ4fegzkInXPgPz3d X-Received: by 10.224.57.68 with SMTP id b4mr188980333qah.63.1386628260590; Mon, 09 Dec 2013 14:31:00 -0800 (PST) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [2607:f8b0:4001:c05::22a]) by mx.google.com with ESMTPSA id ki4sm34308428qeb.0.2013.12.09.14.30.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 09 Dec 2013 14:30:59 -0800 (PST) Received: by mail-ig0-f170.google.com with SMTP id k19so1703491igc.1 for ; Mon, 09 Dec 2013 14:30:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymkatz.net; s=g; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XlCGSML6mJK096BP0cNJ6wUDxFnAnseRPop7H69eB0w=; b=DQEMtAUp4IiUgDRlF+/tgPSy0g+Wl1xj9LIGF2aL6giU1JHmqFrCoj0yqF+M++aa2E HsaMDO+yoYWC1904Jet/RYegHCgdi6o1Y76okoTVwyycv8NxmalHlfBE7FB2xn4/Qz5T /LZX+uGMueLgENb8YOcPK0ZBR1D+AcHtXRA6A= MIME-Version: 1.0 X-Received: by 10.42.250.148 with SMTP id mo20mr15390781icb.34.1386628258506; Mon, 09 Dec 2013 14:30:58 -0800 (PST) Received: by 10.42.46.68 with HTTP; Mon, 9 Dec 2013 14:30:58 -0800 (PST) Received: by 10.42.46.68 with HTTP; Mon, 9 Dec 2013 14:30:58 -0800 (PST) In-Reply-To: <20131209215730.D3C0DE17@athena.apache.org> References: <20131209215730.D3C0DE17@athena.apache.org> Date: Mon, 9 Dec 2013 17:30:58 -0500 Message-ID: From: Yehuda Katz To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=20cf300e4e51c8b25804ed218c60 X-Virus-Checked: Checked by ClamAV on apache.org Subject: Re: [users@httpd] Single quotes in ajax POST data getting prefixed with backslash --20cf300e4e51c8b25804ed218c60 Content-Type: text/plain; charset=ISO-8859-1 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" 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@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > --20cf300e4e51c8b25804ed218c60 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

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@clothears.org.uk> w= rote:
I run an instance of apache under OS X which I use to pass data to PHP scri= pts using ajax. If I have a string such as "O'Toole" (without= the double-quotes), then when the string (which I pass through encodeURICo= mponent in the browser) arrives in the PHP script, the single-quote is pref= ixed 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 ha= ving trouble discovering which component (browser, apache, PHP) is adding t= he 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 c= an remove it.

Any guidance as to where to look would be appreciated.

--
Cheers =A0-- =A0Tim



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
--20cf300e4e51c8b25804ed218c60--