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.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page