<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Tue, 18 Jun 2013 16:12:49 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Marcus Bointon's Blog: PHP Base-62 Encoding]]></title>
      <guid>http://www.phpdeveloper.org/news/16706</guid>
      <link>http://www.phpdeveloper.org/news/16706</link>
      <description><![CDATA[<p>
In a recent post <i>Marcus Bointon</i> looks at a hashing method that's not one as commonly used by developers as the usual <a href="http://php.net/base64_encode">base64</a> - <a href="http://marcus.bointon.com/archives/92-PHP-Base-62-encoding.html">base-62 encoding</a> that plays a bit nicer with things like URLs and emails due to the character set it allows.
</p>
<blockquote>
There's a really horrible bug (though they won't call it that!) in Apache's mod_rewrite that means that urlencoded inputs in rewrites get unescaped in their transformation to output patterns. The bug actually remains unfixed, though a workaround first appeared in Apache 2.2.12. [...] Base-62 is interesting as it can be made safe for use in URLs, DNS, email addresses and pathnames, unlike any available encoding of base-64, as it only includes [0-9A-Za-z].
</blockquote>
<p>
He originally wrote his own parser, but notes that now the <a href="http://li.php.net/manual/en/book.bc.php">BCMath</a> and <a href="http://li.php.net/manual/en/book.gmp.php">gmp</a> extensions make it much simpler, just a call to <a href="http://www.php.net/gmp_strval">gmp_strval</a> with <a href="http://www.php.net/gmp_init">gmp_init</a>. This method works, but it's still not quite all he wanted so he <a href="https://gist.github.com/1139429">created his own encoder</a> to do the job.
</p>]]></description>
      <pubDate>Thu, 11 Aug 2011 11:28:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Evert Pot's Blog: Creating Streams from Strings in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/11859</guid>
      <link>http://www.phpdeveloper.org/news/11859</link>
      <description><![CDATA[<p>
<i>Evert Pot</i> has a <a href="http://www.rooftopsolutions.nl/article/222">quick post</a> on a handy little topic - making streams from strings with PHP (see some of it in action on <a href="http://www.phpdeveloper.org/news/11857">Davey Shafik's blog</a>).
</p>
<blockquote>
There are situations where a string instead needs to be used, and for these purposes the data: stream wrapper is used. Initially I thought it was only possible to encode the actual string in base64, which I didn't like because of the added footprint. [...] Quickly checking out the rfc, it turns out that ';base64' can be omitted to just pass along the raw data, which makes a lot more sense in the context of PHP.
</blockquote>
<p>
His example takes in an example string and pushes it back out the other side after base64 encoding and decoding it. <i>Davey Shafik</i> <a href="http://www.phpdeveloper.org/news/11857">found a use</a> for it in avoiding an <a href="http://php.net/eval">eval</a> call.
</p>]]></description>
      <pubDate>Mon, 02 Feb 2009 12:58:50 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Davey Shafik's Blog: Avoiding EVAL()]]></title>
      <guid>http://www.phpdeveloper.org/news/11857</guid>
      <link>http://www.phpdeveloper.org/news/11857</link>
      <description><![CDATA[<p>
<i>Davey Shafik</i> has a <a href="http://pixelated-dreams.com/archives/232-avoiding-eval.html">helpful hint</a> for avoiding one of the worst functions to use in PHP - <a href="http://php.net/eval">eval</a>.
</p>
<blockquote>
There are a shed-load of ways to "eval()" code without actually calling the eval() function '" usually done simply to avoid the use of the dreaded "evil()" function, but often times because the system has eval() disabled using "disable_functions" in php.ini. Here is another simple way to avoid eval() without writing out files to the filesystem
</blockquote>
<p>
His example uses the streams wrapper to natively execute the code from a string variable as a data element, base64 decoded. It's more of a proof-of-concept than anything else, but its an interesting solution to a tough problem to solve at times.
</p>]]></description>
      <pubDate>Mon, 02 Feb 2009 11:15:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Cyberlot's Blog: Funny little php "virus" floating around]]></title>
      <guid>http://www.phpdeveloper.org/news/7257</guid>
      <link>http://www.phpdeveloper.org/news/7257</link>
      <description><![CDATA[<p>
<i>Richard Thomas</i> <a href="http://www.cyberlot.net/funny-little-php-virus-floating-around">comments on</a> a "funny little PHP 'virus'" that he's noticed coming to him via emails:
</p>
<blockquote>
Got an email that claimed to be from my host, it used a generic return address and talked about security upgrades and such and how due to new policy to help keep a secure data center I was required to upload and run 1 of 2 files in a zip attachment, the first was a php file the other was an asp file.
</blockquote>
<p>
Of course, it wasn't from the host, so he investigated a little further to find out exactly what was going on with the file. Basically, it was a modified nsTView file with some added emailing and password discovery code. The code was "hidden" though - through a base64_encode call on one side and then decoded it on the other to cause the server to execute the code. He <a href="http://www.cyberlot.net/funny-little-php-virus-floating-around">even posts</a> and example of what the base64ed code might look like.
</p>]]></description>
      <pubDate>Mon, 12 Feb 2007 09:58:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP Security Blog: PHP 5.2.0 and allow_url_include]]></title>
      <guid>http://www.phpdeveloper.org/news/6634</guid>
      <link>http://www.phpdeveloper.org/news/6634</link>
      <description><![CDATA[<p>
On the PHP Security Blog, <i>Stefan Esser</i> has posted some of <a href="http://blog.php-security.org/archives/45-PHP-5.2.0-and-allow_url_include.html">his own opinions</a> on the latest PHP release - version 5.2 - and some of the security implications of it.
</p>
<blockquote>
Often users have requested that PHP allows disabling URL support for include and require statements while allowing it for the other filesystem functions. Because of this it was planned to have allow_url_include in PHP 6. After some discussion the feature was backported to the PHP 5.2.0 tree.
</blockquote>
<p>
He <a href="http://blog.php-security.org/archives/45-PHP-5.2.0-and-allow_url_include.html">also notes</a> that, unfortunately, this functionality only protects against the http(s) and ftp(s) kinds of URLs and not some of the new data URLs included in the functionality of PHP 5.2. He gives two code examples of this kind of issue - one using the "pph://input" and the other using a base64 encoded value.
</p>]]></description>
      <pubDate>Fri, 03 Nov 2006 09:41:23 -0600</pubDate>
    </item>
  </channel>
</rss>
