Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Manage2 API for PHP (cpl-3.6) patch

Discussion in 'Workarounds and Optimization' started by chilinux, Sep 12, 2014.

  1. chilinux

    chilinux Registered

    Joined:
    Sep 12, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    DataCenter Provider
    Modifying any of the cpl-3.6 examples with:
    $cpl->set_format("json");

    Would result in the error:
    PHP Notice: Undefined variable: format in cpl-3.6/php/cpl.inc.php on line 39

    The following patch seems to address the error:
    Code:
    --- cpl-3.6/php/cpl.inc.php     2012-01-26 12:47:42.000000000 -0600
    +++ cpl-3.6-mod/php/cpl.inc.php 2014-09-12 18:33:06.875875007 -0500
    @@ -36,7 +36,7 @@
                 return;
             }
             if ($this->format != "simplexml") {
    -            $args['output'] = $format;
    +            $args['output'] = $this->format;
             }
             $query = "https://manage2.cpanel.net/" . $function . "?" . http_build_query($args);
             curl_setopt($this->curl, CURLOPT_URL, $query);
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,896
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    I have moved this thread to the "Workarounds" forum. Please ensure you open a bug report so we can reproduce the issue and open an internal case if necessary:

    Submit A Bug Report

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice