<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.3" -->
<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/"
	>

<channel>
	<title>PHP-Scripts Blog &#187; Information</title>
	<link>http://www.php-scripts.com</link>
	<description>Writing about PHP scripting since 12/99. Learn something new every day.</description>
	<pubDate>Thu, 09 Oct 2008 14:17:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>
	<language>en</language>
			<item>
		<title>PHP still #4 programming language, Ruby on the move in TIOBE index</title>
		<link>http://www.php-scripts.com/20070315/102/</link>
		<comments>http://www.php-scripts.com/20070315/102/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 10:14:32 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[News]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20070315/102/</guid>
		<description><![CDATA[The TIOBE Programming Community index tracks the popularity of different programming languages. Over the last year positions #1-6 have not changed with PHP holding at #4 behind Java (#1), C (#2) and C++ (#3).

Heard a lot about Ruby over the last year or so? It moved from #21 to #11. Definitely on the move.
]]></description>
			<content:encoded><![CDATA[<p>The TIOBE Programming Community <a href="http://www.tiobe.com/tpci.htm">index tracks</a> the popularity of different programming languages. Over the last year positions #1-6 have not changed with PHP holding at #4 behind Java (#1), C (#2) and C++ (#3).</p>
<p><img src="http://www.php-scripts.com/images/2007/tiobe-php032007.jpg" alt="PHP still #4" border="0"/></p>
<p>Heard a lot about Ruby over the last year or so? It moved from #21 to #11. Definitely on the move.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20070315/102/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Yahoo has PHP programming positions available</title>
		<link>http://www.php-scripts.com/20070131/100/</link>
		<comments>http://www.php-scripts.com/20070131/100/#comments</comments>
		<pubDate>Thu, 01 Feb 2007 00:44:57 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Employment]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20070131/100/</guid>
		<description><![CDATA[Rasmus Lerdorf, creator of PHP, posts about PHP programming positions available at Yahoo:
Send me your resume and let me know what sort of stuff you are interested in or poke around on http://careers.yahoo.com/ and let me know which job interests you and I will forward your resume to the appropriate hiring manager.
]]></description>
			<content:encoded><![CDATA[<p>Rasmus Lerdorf, creator of PHP, <a href="http://toys.lerdorf.com/archives/44-guid.html">posts</a> about PHP programming positions available at Yahoo:<br />
<blockquote>Send me your resume and let me know what sort of stuff you are interested in or poke around on <a href="http://careers.yahoo.com/">http://careers.yahoo.com/</a> and let me know which job interests you and I will forward your resume to the appropriate hiring manager.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20070131/100/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perl to PHP cheatsheet</title>
		<link>http://www.php-scripts.com/20070125/99/</link>
		<comments>http://www.php-scripts.com/20070125/99/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 00:39:34 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20070125/99/</guid>
		<description><![CDATA[Sooner or later you may want or need to port some Perl code to PHP. This Perl to PHP translation cheatsheet may come in handy.
]]></description>
			<content:encoded><![CDATA[<p>Sooner or later you may want or need to port some Perl code to PHP. This Perl to PHP translation <a href="http://www.cs.wcupa.edu/~rkline/perl2php/#basedir">cheatsheet</a> may come in handy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20070125/99/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Trying out Websnapr [blog news]</title>
		<link>http://www.php-scripts.com/20061019/93/</link>
		<comments>http://www.php-scripts.com/20061019/93/#comments</comments>
		<pubDate>Thu, 19 Oct 2006 18:06:19 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20061019/93/</guid>
		<description><![CDATA[Blog news that is unrelated to PHP:
When you hover over some of the third party links starting with the last couple posts, I&#8217;m trying out Websnapr to deliver thumbnail previews. You can also hover over Websnapr link. I&#8217;m noticing several &#8220;thumbnail in queue&#8221; messages at the moment and remain curious how long this will take [...]]]></description>
			<content:encoded><![CDATA[<p>Blog news that is unrelated to PHP:</p>
<p>When you hover over some of the third party links starting with the last couple posts, I&#8217;m trying out <a href="http://www.websnapr.com/previewbubble/" class="previewlink">Websnapr</a> to deliver thumbnail previews. You can also hover over Websnapr link. I&#8217;m noticing several &#8220;thumbnail in queue&#8221; messages at the moment and remain curious how long this will take to deliver the thumbnails.</p>
<p><b>Update 2:38pm PST</b>: Looks like updated thumb will appear within a couple hours.<br />
<b>10/23/06 8:43am PST</b>: Wordpress <a href="http://andufo.com/proyectos/wp-websnapr/">Websnapr plugin</a></p>
<p><b>Update 2/8/07 8:26pm PST</b>: The Websnapr service has been disabled on this blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20061019/93/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Colorized PHP ASCII art</title>
		<link>http://www.php-scripts.com/20060703/87/</link>
		<comments>http://www.php-scripts.com/20060703/87/#comments</comments>
		<pubDate>Mon, 03 Jul 2006 16:17:58 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20060703/87/</guid>
		<description><![CDATA[Generate PHP ASCII art in color online.

]]></description>
			<content:encoded><![CDATA[<p>Generate <a href="http://www.purephp.net/ascii-art-generator/">PHP ASCII art</a> in color online.</p>
<p><img src="http://www.php-scripts.com/images/2006/php-td-ascii.jpg" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060703/87/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to fix reBlog 2.0b2 URL sanitizing bug</title>
		<link>http://www.php-scripts.com/20060617/86/</link>
		<comments>http://www.php-scripts.com/20060617/86/#comments</comments>
		<pubDate>Sat, 17 Jun 2006 18:39:14 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Bugs]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20060617/86/</guid>
		<description><![CDATA[Behavior: Links in Reblog cannot be &#8216;archived&#8217; or &#8216;published&#8217;
Problem: Reblog wasn&#8217;t sanitizing the &#8216;link&#8217; field in the MySQL table properly, allowing injection of unescaped single quotes (&#8217;) from RSS feeds into the database. The query would fail and thus would never process properly.
File: Controller.class.php in /refeed/library/RF
Version: $Revision: 1.40 (reBlog version 2.0b2)
Status: Bug reported with code [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Behavior</strong>: Links in Reblog cannot be &#8216;archived&#8217; or &#8216;published&#8217;<br />
<strong>Problem</strong>: Reblog wasn&#8217;t sanitizing the &#8216;link&#8217; field in the MySQL table properly, allowing injection of unescaped single quotes (&#8217;) from RSS feeds into the database. The query would fail and thus would never process properly.<br />
<strong>File</strong>: Controller.class.php in /refeed/library/RF<br />
<strong>Version: $Revision: 1.40 (reBlog version 2.0b2)<br />
</strong><strong>Status</strong>: Bug reported with code fix implemented below. I didn&#8217;t see a solution posted in the official <a href="http://sourceforge.net/forum/forum.php?forum_id=363574">Reblog help forum</a>. I have posted about the issue there and linked here.</p>
<p><strong>Example database call</strong> (http part is stripped so WP doesn&#8217;t make a link, error emphasized)<br />
mysql> select link from items where link like &#8216;%\&#8217;%';</p>
<p>| businessweek.com/technology/content/jun2006/tc20060615_290127.htm?<br />
chan=technology_technology+index+page_more+of+today<font color="red"><strong>&#8216;</strong></font>s+top+stories |</p>
<p>1 row in set (1.81 sec)</p>
<p>Note: this link isn&#8217;t being sent properly by del.icio.us either. It should have been converted to a safe URL by them and then transported through the RSS feed. This leaves the problem to the aggregator to sanitize before entering the database &#8212; which should always be done anyway.</p>
<p>This URL bug ran through three places: businessweek RSS feed (source), delicious popular (tagged) and reblog (aggregator, and into the database).</p>
<p>The proper code to sanitize query strings from URLs like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$the_link</span> = <span class="st0">&#8220;?chan=technology_technology+index+page_more+of+today‘s+top+stories&#8221;</span>;<br />
<a href="http://www.php.net/print"><span class="kw3">print</span></a> <span class="st0">&#8220;before: $the_link</p>
<p>&lt;hr /&gt;After: &#8220;</span> . <a href="http://www.php.net/urlencode"><span class="kw3">urlencode</span></a><span class="br0">&#40;</span><span class="re0">$the_link</span><span class="br0">&#41;</span>;</div>
</div>
<p>If this step had been taken before transferring the URL to the source RSS feed (businessweek) or in the tagging (delicious popular) then it wouldn&#8217;t be needed in the RSS Aggregator (Reblog). Since that&#8217;s not the case, I decided to modify the Reblog code to deal with unsanitized URLs before they reach the database and render future database writes in Reblog disfunctional. Because Reblog can use multiple input sources it makes more sense to alter the point just before the save routine rather than alter the code of each input source (like magepieRSS).</p>
<p><strong>Reblog</strong><br />
1. locate Controller.class.php in /refeed/library/RF<br />
2. line to patch is in saveItem() function starting around line 1679 as follows:</p>
<p>Locate this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">function</span> saveItem<span class="br0">&#40;</span>&amp;<span class="re0">$item</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="re0">$dbhw</span> =&amp; <span class="re0">$this</span>-&gt;<span class="me1">getWriteHandle</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$data</span> = <span class="re0">$item</span>-&gt;<span class="me1">columnNamesValues</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</div>
<p>And <strong>CHANGE</strong> to this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">function</span> saveItem<span class="br0">&#40;</span>&amp;<span class="re0">$item</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
<span class="re0">$dbhw</span> =&amp; <span class="re0">$this</span>-&gt;<span class="me1">getWriteHandle</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$data</span> = <span class="re0">$item</span>-&gt;<span class="me1">columnNamesValues</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// sanitize all links being saved with single quote</span><br />
<span class="re0">$data</span><span class="br0">&#91;</span><span class="st0">&#8216;link&#8217;</span><span class="br0">&#93;</span> = <a href="http://www.php.net/str_replace"><span class="kw3">str_replace</span></a><span class="br0">&#40;</span><span class="st0">&#8220;&#8216;&#8221;</span>,<span class="st0">&#8220;%27&#8243;</span>,<span class="re0">$data</span><span class="br0">&#91;</span><span class="st0">&#8216;link&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Notice this patch string replaces any instance of the single quote character in the link to the %27 sanitized version. A more comprehensive fix would be to urlencode the query string portion of the URL shown earlier in this post. My concern was fixing that specific character which kept causing problems.</p>
<p>You can test this issue in your version of Reblog with the broken del.icio.us feed cached here (not linked):<br />
php-scripts.com/examples/popular-delicious_06172006.xml</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060617/86/feed/</wfw:commentRss>
		</item>
		<item>
		<title>cURL man page on the web</title>
		<link>http://www.php-scripts.com/20060512/83/</link>
		<comments>http://www.php-scripts.com/20060512/83/#comments</comments>
		<pubDate>Fri, 12 May 2006 20:09:50 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20060512/83/</guid>
		<description><![CDATA[If you are wondering about the cURL modifiers, the official man page has the details. Found this handy today while looking up what the -I does. The grabs the headers only.
]]></description>
			<content:encoded><![CDATA[<p>If you are wondering about the cURL modifiers, the <a href="http://curl.haxx.se/docs/manpage.html">official man page</a> has the details. Found this handy today while looking up what the -I does. The grabs the headers only.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060512/83/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bendable runtime methods and member variables in PHP5</title>
		<link>http://www.php-scripts.com/20060222/80/</link>
		<comments>http://www.php-scripts.com/20060222/80/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 03:40:39 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[PHP 5.x]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/20060222/80/</guid>
		<description><![CDATA[IBM:
The introduction of new object-oriented programming (OOP) features in PHP V5 has significantly raised the level of functionality in this programming language. Not only can you have private, protected, and public member variables and functions &#8212; just as you would in the Java™, C++, or C# programming languages &#8212; but you can also create objects [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www-128.ibm.com/developerworks/opensource/library/os-php-flexobj/?ca=dgr-lnxw07DynamicPHP">IBM</a>:<br />
<blockquote>The introduction of new object-oriented programming (OOP) features in PHP V5 has significantly raised the level of functionality in this programming language. Not only can you have private, protected, and public member variables and functions &#8212; just as you would in the Java™, C++, or C# programming languages &#8212; but you can also create objects that bend at runtime, creating new methods and member variables on the fly. You can&#8217;t do that with the Java, C++, or C# languages.</p></blockquote>
<p>How many readers are using PHP 5 now in a production environment? We are still using in test environment but getting closer to deploying on a production box.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060222/80/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pro and anti-PHP arguments</title>
		<link>http://www.php-scripts.com/20060221/79/</link>
		<comments>http://www.php-scripts.com/20060221/79/#comments</comments>
		<pubDate>Tue, 21 Feb 2006 23:12:56 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=79</guid>
		<description><![CDATA[Tim Bray writes a piece describing what he dislikes about PHP: &#8220;&#8230; all the PHP code I’ve seen in that experience has been messy, unmaintainable crap. Spaghetti SQL wrapped in spaghetti PHP wrapped in spaghetti HTML, replicated in slightly-varying form in dozens of places.&#8221;
Harry Fuecks counters at SitePoint with what he likes about PHP.
I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Tim Bray writes a piece describing what he <a href="http://www.tbray.org/ongoing/When/200x/2006/02/17/PHP">dislikes about PHP</a>: &#8220;&#8230; all the PHP code I’ve seen in that experience has been messy, unmaintainable crap. Spaghetti SQL wrapped in spaghetti PHP wrapped in spaghetti HTML, replicated in slightly-varying form in dozens of places.&#8221;</p>
<p>Harry Fuecks counters at SitePoint with <a href="http://www.sitepoint.com/blogs/2006/02/21/a-pro-php-rant/">what he likes about PHP</a>.</p>
<p>I don&#8217;t get into platform zealotry one way or another whether it be OS (I use Windows, Linux and Mac) or programming languages. Languages are tools. I like PHP for web development but it&#8217;s one of many tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20060221/79/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blog Explosion looking to hire a PHP / MySQL programmer</title>
		<link>http://www.php-scripts.com/20051215/74/</link>
		<comments>http://www.php-scripts.com/20051215/74/#comments</comments>
		<pubDate>Thu, 15 Dec 2005 22:05:27 +0000</pubDate>
		<dc:creator>TDavid</dc:creator>
		
		<category><![CDATA[Employment]]></category>

		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.php-scripts.com/?p=74</guid>
		<description><![CDATA[Earlier over at Hmm, I was writing about Blog Explosion and I just received an email that says they are looking for a PHP / programmer. Here are the details:
Lead Developer/ Programmer
You should have an extensive knowledge of the following
- extensive knowledge of PHP
- MySQL
- HTML/CSS
- other? 
If this is you let us know. We [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier over at Hmm, I was writing about <a href="http://www.blogexplosion.com/index.php?ref=TDavid">Blog Explosion</a> and I just received an email that says they are looking for a PHP / programmer. Here are the details:<br />
<blockquote>Lead Developer/ Programmer</p>
<p>You should have an extensive knowledge of the following<br />
- extensive knowledge of PHP<br />
- MySQL<br />
- HTML/CSS<br />
- other? </p>
<p>If this is you let us know. We will need to know more about your programming history and the time available you have to put towards developing BlogExplosion. Please send us a support ticket and let us know all about you.</p></blockquote>
<p>Depending on the compensation, it could be a good gig with an company innovating (or reinventing wheels, whichever your take) in the blog traffic scene. Creative jobs can be fun.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.php-scripts.com/20051215/74/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

