<?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>zeyaLabs &#187; programming</title>
	<atom:link href="http://www.zeyalabs.ch/tags/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zeyalabs.ch</link>
	<description>Binary and Plain Stuff... and more</description>
	<lastBuildDate>Tue, 30 Nov 2010 14:27:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Unwanted Escaping Backslashes in WordPress 2.9</title>
		<link>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/</link>
		<comments>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 14:05:51 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[weird]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=161</guid>
		<description><![CDATA[After an update of a WordPress installation (2.8.5 to 2.9.1), I noticed that one of the plugins, Stray Random Quotes, stopped working properly: each time I submitted or updated a quote containing apostrophes or quotation marks, it came with escaping backslashes in front of these characters. A couple of teacups later I figured out what&#160;<a class="more" href="http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>After an update of a WordPress installation (2.8.5 to 2.9.1), I noticed that one of the plugins, <a href="http://wordpress.org/extend/plugins/stray-quotes/" target="_blank" class="extlink">Stray Random Quotes</a>, stopped working properly: each time I submitted or updated a quote containing apostrophes or quotation marks, it came with escaping backslashes in front of these characters.</p>
<p>A couple of teacups later I figured out what was causing the issue. In the old <code>wp-settings.php</code> file there was this line of code forcing <code>$_REQUEST</code> to be <code>$_GET</code> + <code>$_POST</code>:</p>
<pre class="brush: php; light: true; title: ; notranslate">
$_REQUEST = array_merge($_GET, $_POST);
</pre>
<p>In the old version it was closer to the beginning of the file, on line 51, but somewhere between versions 2.8.5 and 2.9.1 it was moved to line 637. Right <em>after</em> this part:</p>
<pre class="brush: php; light: true; title: ; notranslate">
$_GET    = add_magic_quotes($_GET   );
$_POST   = add_magic_quotes($_POST  );
$_COOKIE = add_magic_quotes($_COOKIE);
$_SERVER = add_magic_quotes($_SERVER);
</pre>
<p>Stray Quotes uses <code>$_REQUEST</code> to process submitted data. There we go.</p>
<p>I&#8217;m sure the folks at WordPress had their reasons for such a change (that&#8217;s why I&#8217;m calling it an &#8220;issue&#8221; and not a &#8220;problem&#8221;), it&#8217;s just that I can&#8217;t help wondering how many plugins (or even parts of the core) were affected by it. Last week, I was setting up a <a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank" class="extlink">NextGEN Gallery</a> on another — fresh — installation of WordPress 2.9.1, and watched the same behavior when filling in photo captions. I admit I didn&#8217;t look into it then, but today I got suspicious all right.</p>
<p>Now, I reckon you want a solution&#8230; Sorry to disappoint you, but I can&#8217;t give you one. Not a <em>quick</em> one, at least.</p>
<p>What about writing to support guys, you&#8217;re probably asking yourself now? Don&#8217;t. I really doubt that this change can (or should, for that matter) be reversed in future versions of WordPress. Like I said, there must have been a reason for it.</p>
<p>So I&#8217;d say the best thing you can do is to figure out which plugins among those installed on your system(s) are affected, and contact their developers with either the information on the issue or, if you can, an implementation of the fix. And wait for updates.</p>
<p>Just please don&#8217;t go hack the core!</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Funwanted-escaping-backslashes-in-wordpress-2-9%2F&amp;title=Unwanted%20Escaping%20Backslashes%20in%20WordPress%202.9" id="wpa2a_2"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/unwanted-escaping-backslashes-in-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Shoot Yourself in the Foot</title>
		<link>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/</link>
		<comments>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 09:12:52 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=145</guid>
		<description><![CDATA[Maybe you&#8217;ve seen one of those funny quick guides to programming languages based on Bjarne Stroustrup&#8217;s &#8220;foot shooting&#8221;, like the one I found on Michael Thompson&#8217;s blog (this is the most complete list of languages I&#8217;ve seen so far). Read it first if you haven&#8217;t. Here&#8217;s my two cents. PHP: You shoot yourself in the&#160;<a class="more" href="http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Maybe you&#8217;ve seen one of those funny quick guides to programming languages based on <a href="http://www.research.att.com/~bs/" target="_blank" class="extlink">Bjarne Stroustrup&#8217;s</a> <a href="http://www.research.att.com/~bs/bs_faq.html#really-say-that" target="_blank" class="extlink">&#8220;foot shooting&#8221;</a>, like the one I found on <a href="http://michaelthompson.org/weblog/pages/THE_PROGRAMMERS_QUICK_GUIDE_TO_THE_LANGUAGES.html" target="_blank" class="extlink">Michael Thompson&#8217;s blog</a> (this is the most complete list of languages I&#8217;ve seen so far). Read it first if you haven&#8217;t.</p>
<p>Here&#8217;s my two cents.</p>
<p><strong>PHP:</strong> You shoot yourself in the foot and spend the rest of the week making sure that nobody else can pull the trigger of your gun which is now stuck between your belt and your belly. That involves both gun, belt, and room tweaking.</p>
<p><strong>Java:</strong> You find that the standard implementation of RFC NNN-1 (Gun) lacks the trigging mechanism, so you check Apache Commons if they have an alternative. They do, bit it doesn&#8217;t fit the standard implementation of RFC NNN-2 (Bullet), and there is no Commons&#8217; alternative to that one. You are in the middle of implementing your own Bullet when someone says there is already a project for that. You download a shareware version which turns out to be a blank shot. You pay for the armed one but they never send it to you. In the end, you take the standard implementation of RFC XXX (Axe) and chop your foot off.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fshoot-yourself-in-the-foot%2F&amp;title=Shoot%20Yourself%20in%20the%20Foot" id="wpa2a_4"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/shoot-yourself-in-the-foot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

