[SERVER-1302] Properly escape string in tosjon() Created: 25/Jun/10  Updated: 12/Jul/16  Resolved: 25/Jun/10

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: None
Fix Version/s: 1.5.4

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

> tojson("asdf\x00adsf")
"asdfadsf"

should be "asdf\u0000asdf"

> tojson("asdf\nadsf")
"asdf
adsf"

should be "asdf\nasdf"

> tojson("asdf
adsf")
"asdf\adsf"

should be "asdf
asdf"



 Comments   
Comment by auto [ 25/Jun/10 ]

Author:

{'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}

Message: better escaping in tojson function SERVER-1302
http://github.com/mongodb/mongo/commit/1924e96788d316add476acd7a954c255e3e7f91a

Generated at Thu Feb 08 02:56:39 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.