From b8d3c3defbef3563889641bf4448eeaa51519e42 Mon Sep 17 00:00:00 2001
From: Derek Jones
Date: Wed, 24 Jun 2009 15:27:01 +0000
Subject: some mods to xmlrpc library to handle data types better, and to
exit() content so Output class does not muck with it
---
system/libraries/Xmlrpc.php | 6 +++---
system/libraries/Xmlrpcs.php | 2 +-
user_guide/changelog.html | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/system/libraries/Xmlrpc.php b/system/libraries/Xmlrpc.php
index 4a5b97fb9..2022a7eba 100644
--- a/system/libraries/Xmlrpc.php
+++ b/system/libraries/Xmlrpc.php
@@ -1351,13 +1351,13 @@ class XML_RPC_Values extends CI_Xmlrpc
switch ($typ)
{
case $this->xmlrpcBase64:
- $rs .= "<{$typ}>" . base64_encode($val) . "{$typ}>\n";
+ $rs .= "<{$typ}>" . base64_encode((string)$val) . "{$typ}>\n";
break;
case $this->xmlrpcBoolean:
- $rs .= "<{$typ}>" . ($val ? '1' : '0') . "{$typ}>\n";
+ $rs .= "<{$typ}>" . ((bool)$val ? '1' : '0') . "{$typ}>\n";
break;
case $this->xmlrpcString:
- $rs .= "<{$typ}>" . htmlspecialchars($val). "{$typ}>\n";
+ $rs .= "<{$typ}>" . htmlspecialchars((string)$val). "{$typ}>\n";
break;
default:
$rs .= "<{$typ}>{$val}{$typ}>\n";
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index b7382fae9..c7daa600f 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -123,7 +123,7 @@ class CI_Xmlrpcs extends CI_Xmlrpc
header("Content-Type: text/xml");
header("Content-Length: ".strlen($payload));
- echo $payload;
+ exit($payload);
}
//-------------------------------------
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 3ae2cb612..9db5c1506 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -96,6 +96,7 @@ SVN Revision:
Fixed a bug where Database Forge's add_column and modify_column were not looping through when sent multiple fields.
Fixed a bug where the File Helper was using '/' instead of the DIRECTORY_SEPARATOR constant.
Fixed a bug to prevent PHP errors when attempting to use sendmail on servers that have manually disabled the PHP popen() function.
+ Fixed a bug that would cause PHP errors in XML-RPC data if the PHP data type did not match the specified XML-RPC type.
Version 1.7.1
--
cgit v1.2.3-24-g4f1b