New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON export mis-escapes single quotes #12304

Closed
patrickschu opened this Issue Jun 8, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@patrickschu

patrickschu commented Jun 8, 2016

Steps to reproduce

  1. I have a JSON output from "Export to JSON plugin for PHPMyAdmin @version 0.1"
  2. I read it into Python using the json module.
  3. It returns a ValueError: Invalid \escape: line X column Y (char Z) after trying a json.loads().
  4. Apparently, single quotes need not be escaped in JSON. I figure that's what this trips up the parser.

Expected behaviour

It should parse it as a JSON file; it does so if I remove instances of ' with a regex .

Actual behaviour

It gives me the error desribed above.

configuration

Operating system:
Mac OS X Yosemite, Python 2.7
Thanks!
Web server:

Database:

PHP version:

phpMyAdmin version:

Client configuration

Browser:

Operating system:

@ibennetch

This comment has been minimized.

Show comment
Hide comment
@ibennetch

ibennetch Jun 9, 2016

Member

Could you please tell us which phpMyAdmin version you're using? I'm not able to reproduce this; in my tests I get data like don't, not don\'t.

Member

ibennetch commented Jun 9, 2016

Could you please tell us which phpMyAdmin version you're using? I'm not able to reproduce this; in my tests I get data like don't, not don\'t.

@nijel

This comment has been minimized.

Show comment
Hide comment
@nijel

nijel Jun 9, 2016

Member

Also we use json_encode to do this, so it might be as well bug in PHP, so PHP version could be useful as well.

Member

nijel commented Jun 9, 2016

Also we use json_encode to do this, so it might be as well bug in PHP, so PHP version could be useful as well.

nijel added a commit that referenced this issue Jun 9, 2016

Include phpMyAdmin version in JSON dump
This provides useful information, the 0.1 string was not really helpful.

Issue #12304

Signed-off-by: Michal Čihař <michal@cihar.com>

@nijel nijel added the question label Jun 9, 2016

@nijel

This comment has been minimized.

Show comment
Hide comment
@nijel

nijel Jun 9, 2016

Member

However if you are using 4.0.x release, the json_encode was not used and such problems could be found, see 0ee0d8e. So this would be duplicate of #10135 then...

Member

nijel commented Jun 9, 2016

However if you are using 4.0.x release, the json_encode was not used and such problems could be found, see 0ee0d8e. So this would be duplicate of #10135 then...

@nijel nijel self-assigned this Jun 9, 2016

@patrickschu

This comment has been minimized.

Show comment
Hide comment
@patrickschu

patrickschu Jun 9, 2016

Hi Michal,

Thanks for your email! In that case, please disregard my bug report. While
I did search beforehand, I must have missed that one.

Thanks for looking into this!

Patrick

On Thu, Jun 9, 2016 at 2:24 AM, Michal Čihař notifications@github.com
wrote:

However if you are using 4.0.x release, the json_encode was not used and
such problems could be found, see 0ee0d8e
0ee0d8e.
So this would be duplicate of #10135
#10135 then...


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#12304 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AK14ndIGATD6NMkJ2z6WMQ4QhLslnrwAks5qJ7-igaJpZM4IxCrH
.

Department of English
University of Texas at Austin
204 W 21st Street B5000
Austin, Texas 78712-1164

patrickschu commented Jun 9, 2016

Hi Michal,

Thanks for your email! In that case, please disregard my bug report. While
I did search beforehand, I must have missed that one.

Thanks for looking into this!

Patrick

On Thu, Jun 9, 2016 at 2:24 AM, Michal Čihař notifications@github.com
wrote:

However if you are using 4.0.x release, the json_encode was not used and
such problems could be found, see 0ee0d8e
0ee0d8e.
So this would be duplicate of #10135
#10135 then...


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#12304 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AK14ndIGATD6NMkJ2z6WMQ4QhLslnrwAks5qJ7-igaJpZM4IxCrH
.

Department of English
University of Texas at Austin
204 W 21st Street B5000
Austin, Texas 78712-1164

@nijel nijel added bug duplicate and removed question labels Jun 9, 2016

@nijel nijel added this to the 4.1.0 milestone Jun 9, 2016

@nijel nijel closed this Jun 9, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment