php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71501 xmlrpc_encode_request ignores encoding option
Submitted: 2016-02-03 05:56 UTC Modified: 2016-02-04 10:43 UTC
From: letrunghieu dot cse09 at gmail dot com Assigned:
Status: Closed Package: XMLRPC-EPI related
PHP Version: 7.0.0 OS:
Private report: No CVE-ID:
 [2016-02-03 05:56 UTC] letrunghieu dot cse09 at gmail dot com
Description:
------------
The `xmlrpc_encode_request` function ignores the value of `encoding` and `escaping` output options if users do not use a explicit value for the `version` option when calling.

Note: The xmlrpc extension must be loaded first.

Test script:
---------------
<?php

$params = 'Lê Trung Hiếu';

echo xmlrpc_encode_request('foo', $params, ['encoding' => 'UTF-8', 'escaping' => 'markup']);

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>foo</methodName>
<params>
 <param>
  <value>
   <string>Lê Trung Hiếu</string>
  </value>
 </param>
</params>
</methodCall>


Actual result:
--------------
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>foo</methodName>
<params>
 <param>
  <value>
   <string>L&#195;&#170; Trung Hi&#225;&#186;&#191;u</string>
  </value>
 </param>
</params>
</methodCall>

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-02-03 06:22 UTC] letrunghieu dot cse09 at gmail dot com
-PHP Version: 7.0.2 +PHP Version: 7.0.0
 [2016-02-03 06:23 UTC] letrunghieu dot cse09 at gmail dot com
Test with PHP 7.0.0.
 [2016-02-04 10:43 UTC] nikic@php.net
-Summary: xmlrpc_encode_request has incorrect behavior +Summary: xmlrpc_encode_request ignores encoding option
 [2016-02-04 10:46 UTC] nikic@php.net
Automatic comment on behalf of letrunghieu.cse09@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ace71b4c5feb986dd6a4a231bd738d83b41826ab
Log: Fix bug #71501
 [2016-02-04 10:46 UTC] nikic@php.net
-Status: Open +Status: Closed
 [2016-07-20 11:33 UTC] davey@php.net
Automatic comment on behalf of letrunghieu.cse09@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ace71b4c5feb986dd6a4a231bd738d83b41826ab
Log: Fix bug #71501
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC