Menu

#4783 Invalid JSON export

4.3.4
works-for-me
nobody
None
Normal
2015-04-12
2015-03-02
Phyks
No

Hi,

When exporting a database to JSON, PHPMyAdmin produces invalid JSON output. Indeed, PHPMyAdmin introduces new lines characters (instead of escaping them as \n) in the quoted strings in the JSON, which is invalid.

Such output is something like :
{"test": "toto
foobar"}

Thanks

Discussion

  • Marc Delisle

    Marc Delisle - 2015-03-02

    Which phpMyAdmin please? (indicate it in Milestone).

     
  • Phyks

    Phyks - 2015-03-02

    phpMyAdmin from debian stable, 4.3.4.

    My bad, I am new to SourceForge issues and cannot find how to edit my issue =(

     
    • Marc Delisle

      Marc Delisle - 2015-03-03

      Version 4.3.4 is out of date. Can you reproduce this on the stable version 4.3.11 ? (see http://demo.phpmyadmin.net)

       
  • shubham

    shubham - 2015-03-02

    I want to work on this bug! I have forked the phpmyadmin repo and cloned the repo.
    I am new here and is looking for GSoC this summers. Can you help me in solving this bug or some other beginner bugs?

     
    • Marc Delisle

      Marc Delisle - 2015-03-03

      shubham,
      no we cannot help you because solving bugs is a way for us to measure your skills in preparation for GSoC.

       
  • Marc Delisle

    Marc Delisle - 2015-03-03
    • Group: 3.4.7 --> 4.3.4
     
  • Marc Delisle

    Marc Delisle - 2015-03-03
    • status: open --> pending
     
  • Daniyal Shahid

    Daniyal Shahid - 2015-03-04

    I just exported a table to json on version 4.3.11 and i got the output as expected

    [{"id":"test","col":"toto \n foobar"}]

     

    Last edit: Daniyal Shahid 2015-03-04
  • Phyks

    Phyks - 2015-03-05

    Actually, after some tests, I think it could be due to my data being incorrectly encoded. I'll try to post an SQL example to reproduce it.

     
    • Marc Delisle

      Marc Delisle - 2015-04-10

      Feedback please?

       
  • Anonymous

    Anonymous - 2015-04-10

    Tested on pMA version 4.3.4 (git branch MAINT_4_3_4)
    everything works as expected:
    [{"addsports_club_id":"1","image":"images\/addsports\/clubs\/FC_Bayern_Munich.png"}]

    @Phyks what encoding are you using?

     
  • Phyks

    Phyks - 2015-04-12

    Sorry, I forgot to update it.

    I do not have the data at the moment to test it, but I confirm that tentatives to reproduce fails. Hence, I think this was a pure encoding problem and this bug can be closed. Thanks

     
  • Marc Delisle

    Marc Delisle - 2015-04-12
    • status: pending --> works-for-me