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.

xmlapi response contains some weirds characters

Discussion in 'cPanel Developers' started by mickaelandrieu, Nov 11, 2013.

  1. mickaelandrieu

    mickaelandrieu Registered

    Joined:
    Nov 10, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hello,

    look at this very simple sample:
    PHP:
    <?php
    require_once('xmlapi.php');

    $ip 'XX.XXX.XXX.XX';

        
    $accessHash 'XXXXXXXXXXXXXXXXXXXXXXX.....';
    $xmlapi = new xmlapi($ip);
    $xmlapi->set_port(2087);

    $xmlapi->hash_auth("root",$accessHash);
    $xmlapi->set_output('xml');
         
    echo 
    $xmlapi->version(); die;
    Returns :

    Code:
    <version>
      <version>11.40.0.19</version>
    </version>
    ©
    <!-- Web Host Manager 11.40.0.19 (c) cPanel, Inc. 2013 http://cpanel.net/  Unauthorized copying is prohibited. -->
    }
    
    As you can see, response returns some weirds characters. I've checked my files encoding, it's UTF-8.

    Anyone can help me ?

    Regards,
     
  2. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    Not getting the copyright symbol when doing my testing on 11.40.0.19. Perhaps you should try switching to JSON output and seeing if you still get the added characters. JSON output doesn't put the unnecessary footer comment in the page either.
     
  3. mickaelandrieu

    mickaelandrieu Registered

    Joined:
    Nov 10, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi,

    thank you for device hut I'm experimenting the same issue with json output.

    "array" and "simple_xml" output returns null (in my opinion, because the string returned is not a correct xml).

    I edit my precedent post to complete my feedback.

    Regards,
     
  4. mickaelandrieu

    mickaelandrieu Registered

    Joined:
    Nov 10, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hmm,

    sorry for my bad english.

    I want to say "advice" and I can't edit my precedents posts (or I don't know how to do) :D

    Sincerely,
     
  5. KostonConsulting

    KostonConsulting Well-Known Member

    Joined:
    Jun 17, 2010
    Messages:
    255
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    San Francisco, CA
    cPanel Access Level:
    Root Administrator
    Not getting the same thing over here so it's possible that something is going wrong on the server. You may want to check /usr/local/cpanel/logs/error_log for any errors and I'd recommend opening a support ticket as this doesn't appear to be happening on other 11.40.19 servers.

    Here's my test:


    Code:
    <?php
    require_once('../xmlapi.php');
    
    $xmlapi = new xmlapi('XXX.XXX.XXX.XXX');
    $xmlapi->password_auth("root",'XXXXXXXXXXXXXXXXXX');
    $xmlapi->set_output('json');
    
    echo $xmlapi->version(); die;
    
    ?>
    
    $ php version_check.php
    {"version":"11.40.0.19"}


    - - - Updated - - -

    No problem. There should be a button labelled 'Edit Post' with a picture of a pencil that allows you to edit your previous posts.
     
  6. mickaelandrieu

    mickaelandrieu Registered

    Joined:
    Nov 10, 2013
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    I have and very weird issue in my error_log:
    Code:
    Multiple â[quant,_1,â¦â
                           Multiple â[quant,_1,â¦â
                                                  Multiple â[quant,_1,â¦â
                                                                         Multiple â[
    
    
                                                                                    iling variable in output,url: [output,url,_1,cPanel DNSONLY,_2,_3]
    Multiple â[quant,_1,â¦â
                           The number of arguments to quant (3 in [quant,_1,Result,R
    Multiple â[quant,_1,â¦â
    
    Any idea ?

    PS: I actualy don't have "Post Button" so I will be more focused on when I write ;)
     
Loading...

Share This Page