<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Icheb&#039;s blog &#187; PHP</title>
	<atom:link href="http://www.icheb.info/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icheb.info</link>
	<description></description>
	<lastBuildDate>Sun, 23 Jan 2011 21:56:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>The latest IXR library</title>
		<link>http://www.icheb.info/2009/03/the-latest-ixr-library/</link>
		<comments>http://www.icheb.info/2009/03/the-latest-ixr-library/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 22:02:52 +0000</pubDate>
		<dc:creator>Icheb</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IXR]]></category>
		<category><![CDATA[XML-RPC]]></category>

		<guid isPermaLink="false">http://www.icheb.info/?p=72</guid>
		<description><![CDATA[It seems IXR (the Incutio XML-RPC library) is no longer available from a number of websites. So I&#8217;ve uploaded the latest version I&#8217;m currently using for projects. This version does contain most of the changes by Rogier van Dongen, added SSL support (requires CURL) and so on. This version does contain a few small changes,&#8230; <a class="continue_reading" href="http://www.icheb.info/2009/03/the-latest-ixr-library/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>It seems IXR (the Incutio XML-RPC library) is no longer available from a number of websites.</p>
<p>So I&#8217;ve uploaded the latest version I&#8217;m currently using for projects. This version does contain most of the changes by Rogier van Dongen, added SSL support (requires CURL) and so on.</p>
<p>This version does contain a few small changes, to allow certain features to be used in my projects, but no one should have any problems with it.</p>
<p>If you have idea&#8217;s about modifications, please let me know!</p>
<p>You can see the source at: <a href="http://www.icheb.info/IXR.phps">http://www.icheb.info/IXR.phps</a></p>
<p>And download is available from: <a href="http://www.icheb.info/IXR.txt">http://www.icheb.info/IXR.txt</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.icheb.info/2009/03/the-latest-ixr-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IXR (Incutio XML-RPC) with SSL support</title>
		<link>http://www.icheb.info/2007/01/ixr-incutio-xml-rpc-with-ssl-support/</link>
		<comments>http://www.icheb.info/2007/01/ixr-incutio-xml-rpc-with-ssl-support/#comments</comments>
		<pubDate>Sun, 28 Jan 2007 14:24:48 +0000</pubDate>
		<dc:creator>Icheb</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IXR]]></category>
		<category><![CDATA[XML-RPC]]></category>

		<guid isPermaLink="false">http://www.icheb.info/2007/01/28/ixr-incutio-xml-rpc-with-ssl-support/</guid>
		<description><![CDATA[I&#8217;ve been looking for this for ages now, but this morning I actually found someone that had done this, and is still following the XML-RPC conventions. (I&#8217;ve also got a closed source version of this, included in some projects, but it doesn&#8217;t follow the XML-RPC conventions anymore). So I was very glad to find this.&#8230; <a class="continue_reading" href="http://www.icheb.info/2007/01/ixr-incutio-xml-rpc-with-ssl-support/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for this for ages now, but this morning I actually found someone that had done this, and is still following the XML-RPC conventions. (I&#8217;ve also got a <em>closed source</em> version of this, included in some projects, but it doesn&#8217;t follow the XML-RPC conventions anymore).</p>
<p>So I was very glad to find <a href="http://griffin.oobleyboo.com/archive/xmlrpc_1_7_1_release" target="_blank">this</a>. But due to me not using a verified SSL certificate, I ran into some problems.</p>
<p><span id="more-45"></span>I kept getting the following error:</p>
<p><code>* SSL certificate problem, verify that the CA cert is OK. Details:<br />
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed</code><br />
After reading through the code, I created a modified version that solves this issue (just added an additional CURL command to ignore the problem), you can download it from<a href="http://www.icheb.nl/icheb_info_blog/IXR/IXR_Library.inc.php.txt" target="_blank"> this location</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icheb.info/2007/01/ixr-incutio-xml-rpc-with-ssl-support/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another bug in the IXR XML-RPC lib</title>
		<link>http://www.icheb.info/2005/05/another-bug-in-the-ixr-xml-rpc-lib/</link>
		<comments>http://www.icheb.info/2005/05/another-bug-in-the-ixr-xml-rpc-lib/#comments</comments>
		<pubDate>Sun, 22 May 2005 07:58:22 +0000</pubDate>
		<dc:creator>Icheb</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[IXR]]></category>
		<category><![CDATA[XML-RPC]]></category>

		<guid isPermaLink="false">http://www.icheb.info/2007/05/01/another-bug-in-the-ixr-xml-rpc-lib/</guid>
		<description><![CDATA[Some time ago I&#8217;d written a modification to the XML-RPC lib from Incutio (see http://www.icheb.info/2007/01/28/ixr-incutio-xml-rpc-with-ssl-support/). But there was more&#8230; Today, a friend mailed me with a problem (and solution) for a new problem everyone has missed so far. I&#8217;ve placed a modified version online at: http://www.icheb.nl/icheb_info_blog/IXR/IXR_Library.inc.php_2.txt If you actually want to know what&#8217;s wrong, and&#8230; <a class="continue_reading" href="http://www.icheb.info/2005/05/another-bug-in-the-ixr-xml-rpc-lib/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Some time ago I&#8217;d written a modification to the XML-RPC lib from Incutio (see <a href="http://www.icheb.info/2007/01/28/ixr-incutio-xml-rpc-with-ssl-support/">http://www.icheb.info/2007/01/28/ixr-incutio-xml-rpc-with-ssl-support/</a>).</p>
<p>But there was more&#8230; Today, a friend mailed me with a problem (and solution) for a new problem everyone has missed so far.<br />
I&#8217;ve placed a modified version online at: <a href="http://www.icheb.nl/icheb_info_blog/IXR/IXR_Library.inc.php_2.txt">http://www.icheb.nl/icheb_info_blog/IXR/IXR_Library.inc.php_2.txt</a></p>
<p>If you actually want to know what&#8217;s wrong, and why, click the more button below <img src='http://www.icheb.info/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .<br />
<span id="more-48"></span><br />
<em>Recently, I had to create some webservices using the IXR Library.</em></p>
<p><em>After having designed the webservices, I created the server according to a basic IXRServer extend.</em></p>
<p><em>Just to test, I then wrote a simple client, which worked just fine.<br />
However, when I wanted to migrate the PHP based client to an AJAX based web client, I stumbled upon some issues.</em></p>
<p><em>Let me try to explain this by example.</em></p>
<p><em>A pretty normal XML request for IXR looks as follows (without the xml declaration):<br />
</em><code>&lt;pre lang="xml" line="1"&gt;</code></p>
<p>ixr.test.fetchVar</p>
<p>testvar testvar2<br />
&lt;/pre&gt;</p>
<p><em>Take note of the fact that this request has NO typing information, for it cannot be generated by the JS libraries I use.<br />
Under normal circumstances (using the IXRClient), the parameter type information would have shown, as in e.g.:</em><br />
<code>&lt;pre lang="xml" line="1"&gt;</code> testvar testvar2&lt;/pre&gt;<br />
<em><br />
It is exactly this however, that creates the issue. Where the normal IXRCLient will correctly return data,<br />
The AJAX based client will not show anything.</em></p>
<p><em>Digging into the code, I discovered the error. Things start to go wrong as soon as there’s NO typing information available for a parameter.</em></p>
<p><em>Dumping my data, I discovered that all ‘newline’ characters were left intact.<br />
In the case as described, there’s more then one: just after , after and after </em></p>
<p><em>For the first encountered variable, I this end up with a parsed value of “\n\n\ntestvar”<br />
Every encountered newline character seems to be added to the value, but NOT removed, as I expected.</em></p>
<p><em>Now for a solution:<br />
Inside the IXRMessage, things are parsed by an XMLParser.<br />
Inside the ‘tag_close’ call, things are rendered and converted to contain correct values.<br />
Except for in case, the case where there’s no typing information!<br />
In every other case (except for base64), the value to be set is first trim()’d.</em></p>
<p><em>The code for the ‘value’ tag, however, is NOT:</em><br />
<code>&lt;pre lang="PHP" line="1"&gt;</code> case &#8216;value&#8217;:<br />
// &#8220;If no type is indicated, the type is string.&#8221;<br />
if (trim($this-&gt;_currentTagContents) != &#8221;) {<br />
$value = (string)$this-&gt;_currentTagContents;<br />
$this-&gt;_currentTagContents = &#8221;;<br />
$valueFlag = true;<br />
}<br />
break;<br />
&lt;/pre&gt;<br />
<em><br />
As one can see from the code above, the if-statement does a trim, but the trimmed string is NEVER assigned.<br />
One possible solution for the code above could be (I decided to break down in two lines):</em><br />
<code>&lt;pre lang="php" line="1"&gt;</code><br />
if (trim($this-&gt;_currentTagContents) != &#8221;) {<br />
$value = trim($this-&gt;_currentTagContents);<br />
$value = (string)$value;<br />
$this-&gt;_currentTagContents = &#8221;;<br />
$valueFlag = true;<br />
}<br />
break;<br />
&lt;/pre&gt;<br />
<em></em></p>
<p><em>This solution now also strips the surrounding whitespace, tabs, newlines, etc from the input, as can be expected!</em></p>
<p>Rogier van Dongen, thank you for this patch <img src='http://www.icheb.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.icheb.info/2005/05/another-bug-in-the-ixr-xml-rpc-lib/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

