xmlapi response contains some weirds characters

mickaelandrieu

Registered
Nov 10, 2013
4
0
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,
 

mickaelandrieu

Registered
Nov 10, 2013
4
0
1
cPanel Access Level
Reseller Owner
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.
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,
 

KostonConsulting

Well-Known Member
Verifed Vendor
Jun 17, 2010
255
1
68
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 - - -

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,
No problem. There should be a button labelled 'Edit Post' with a picture of a pencil that allows you to edit your previous posts.
 

mickaelandrieu

Registered
Nov 10, 2013
4
0
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 ;)