Req #49366 [Com]: Make slash escaping optional in json_encode()
| From: | php dot net at site dot lanzz dot org | Date: | Mon, 03 Dec 2012 09:31:04 +0000 |
| Subject: | Req #49366 [Com]: Make slash escaping optional in json_encode() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-175080@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=49366&edit=1
ID: 49366
Comment by: php dot net at site dot lanzz dot org
Reported by: don at smugmug dot com
Summary: Make slash escaping optional in json_encode()
Status: Closed
Type: Feature/Change Request
Package: JSON related
Operating System: CentOS 5.3
PHP Version: 5.3.0
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
To me, this issue is just magic quotes being still alive and well, in the year
2012. I thought the lesson of "don't overquote when you don't have to" has been
learned already? Granted, this issue is marginally better than the magic quotes
fiasco, as it doesn't actually change the semantics of the escaped value.
Previous Comments:
------------------------------------------------------------------------
[2012-03-02 17:26:48] diego dot pasc at tiscali dot it
I also agree that NOT ESCAPING should be the default
------------------------------------------------------------------------
[2011-12-16 01:37:05] don at smugmug dot com
I totally agree that this should just be the default, rather than some new
option.
Both ways are 100% JSON compliant, but one (the PHP chosen method) is far less
common, has a significantly larger footprint on lots of common types of data, and
is harder for humans to read. I see no benefit t
------------------------------------------------------------------------
[2011-12-15 22:05:06] dtremblay dot fafard at gmail dot com
Actually, I can't find any reason why is escaping slashes by default and create an option to
remove this feature. Usually, when you want something added (e.g. Escaping Slashes), you use an
option to recreate the feature wanted. So why is the option used to REMOVE a feature? Options exists
to add features, not remove them?? Where am I wrong?
------------------------------------------------------------------------
[2010-09-16 15:53:38] aharvey@php.net
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
I've implemented this on trunk via a json_encode() option called JSON_UNESCAPED_SLASHES. The
default behaviour remains to escape slashes.
------------------------------------------------------------------------
[2010-09-16 15:53:29] aharvey@php.net
Automatic comment from SVN on behalf of aharvey
Revision: http://svn.php.net/viewvc/?view=revision&revision=303421
Log: Implemented FR #49366 (Make slash escaping optional in json_encode()).
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=49366
--
Edit this bug report at https://bugs.php.net/bug.php?id=49366&edit=1