The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Malformed json response

Discussion in 'cPanel Developers' started by dgarciag, May 20, 2011.

  1. dgarciag

    dgarciag Registered
    PartnerNOC

    Joined:
    Feb 16, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi,


    I send this request (cPanel 11.28.87):
    Code:
    ?cpanel_jsonapi_user=user&cpanel_jsonapi_module=Mysql&cpanel_jsonapi_func=deldb&cpanel_jsonapi_apiversion=1&arg-0=user_db
    
    And get this response:
    Code:
    {"apiversion":"1","type":"event","module":"Mysql","func":"deldb","source":"module","data":{"result":"Database "user_db" dropped
    "},"event":{"result":1}}
    
    json_decode returns null, because unscaped line breaks and nested doble-quotes ("user_db" in result) are not valid in json.
    I'm sure that my code is not messing cPanels response: I dump it as soon as it's received and many other calls are working fine.

    Maybe it's a bug in cpanel?

    Thanks!

    Dani
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Dani,

    You are correct. This is a bug in 11.28. It is resolved in 11.30. The fix will not be backported to previous versions. 11.30 is currently being release through the staging tiers; at the time of this post, 11.30 is available in the "CURRENT" release tier. It should be available to you in the "STABLE" tier in the coming weeks.

    Best Regards,
    -DavidN
     
Loading...

Share This Page