<?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>Fri, 24 May 2013 17:11:01 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Elijah Horton: Sandboxing Untrusted Code With PHPSandbox]]></title>
      <guid>http://www.phpdeveloper.org/news/19520</guid>
      <link>http://www.phpdeveloper.org/news/19520</link>
      <description><![CDATA[<p>
<i>Elijah Horton</i> has a recent post to his site sharing a tool he's developed to <a href="http://www.fieryprophet.com/blog/detail/sandboxing-untrusted-code-with-phpsandbox">sandbox and validate PHP code</a> of user-contributed code.
</p>
<blockquote>
Few quotes related to the PHP language are as pithy and resoundingly accurate as the phrase: "Eval is evil." The reasons are myriad: the eval() function basically gives whatever code is passed to it unlimited control of the parser, and this freedom makes eval() both a temptation for developers, who may need to dynamically control PHP at runtime, and a panacea for hackers who are ever-searching for more servers to add to their botnets. So, how does one make use of the extreme power available through runtime evaulation of PHP, without exposing one's server to near-certain rooting? Through a sandbox. 
</blockquote>
<p>
His tool - <a href="https://github.com/fieryprophet/php-sandbox">PHPSandbox</a>, uses the <a href="https://github.com/nikic/PHP-Parser">PHP-Parser</a> library to deconstruct the PHP code its given and look for issues. He gives an example of a call to <a href="http://php.net/mail">mail</a> and how it would catch the issue. He shows how to install it via Composer, how to configure it with whitelisted methods/functions. It also includes a way to overwrite function calls with a bit safer alternative.
</p>
Link: http://www.fieryprophet.com/blog/detail/sandboxing-untrusted-code-with-phpsandbox]]></description>
      <pubDate>Mon, 29 Apr 2013 11:56:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vance Lucas: Valitron: The Simple Validation Library That Doesn't Suck]]></title>
      <guid>http://www.phpdeveloper.org/news/19272</guid>
      <link>http://www.phpdeveloper.org/news/19272</link>
      <description><![CDATA[<p>
<i>Vance Lucas</i> has created a "<a href="http://www.vancelucas.com/blog/valitron-the-simple-validation-library-that-doesnt-suck/">validation library that dosen't suck</a>" and posted about it to his site - his <a href="https://github.com/vlucas/valitron">Valitron</a> library.
</p>
<blockquote>
<a href="https://github.com/vlucas/valitron">Valitron</a> is a simple, minimal and elegant stand-alone PHP validation library with NO dependencies. Valitron uses simple, straightforward validation methods with a focus on readable and concise syntax.
</blockquote>
<p>
He created the library because of frustration with other tools that had (sometimes major) dependencies on other packages. All he wanted was something lightweight and easy to use that was flexible about how it handled its validation rules. <a href="https://github.com/vlucas/valitron">Valitron</a> lets you apply a validation (like "required") against multiple fields in the provided data and includes checks for things like length, valid IP, active URL, alpha-numeric, date format and regular expression match. You can also add custom validation rules via a callback/closure.
</p>]]></description>
      <pubDate>Tue, 05 Mar 2013 11:43:24 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[WebDevRadio: Episode #105 - Font tools, design thoughts, parallel deployment & my Florida road trip]]></title>
      <guid>http://www.phpdeveloper.org/news/18901</guid>
      <link>http://www.phpdeveloper.org/news/18901</link>
      <description><![CDATA[<p>
The latest episode of WebDevRadio has been posted - <a href="http://webdevradio.com/index.php?id=131">Episode #105</a>, "Font tools, design thoughts, parallel deployment, and my Florida road trip".
</p>
<blockquote>
Hello all from sunny Florida :) Recently discovered jquery validation plugin only 6 years too late, and have found some tools that work in conjunction with it, including Pajama, a PHP library. Also have some links to font combination articles and tools, and have recently been using "parallel deployment" in Tomcat 7.
</blockquote>
<p>
The <a href="http://cdmckay.org/blog/2012/12/06/pajama-client-and-server-validation-simplified/">Pajama</a> PHP library does "hybrid validation" and follows the rules of the <a href="http://bassistance.de/jquery-plugins/jquery-plugin-validation/">jQuery validation plugin</a> but for the server side. You can listen to this latest episode either through the <a href="http://webdevradio.com/index.php?id=131">in-page player</a> or by <a href="http://webdevradio.com/get.php?web=podcast-webdevradio-2012-12-15-93463.mp3">downloading the mp3</a>. You can also <a href="http://feeds2.feedburner.com/WebdevradioPodcastHome">subscribe to their feed</a> to get the latest shows.
</p>]]></description>
      <pubDate>Mon, 17 Dec 2012 11:48:09 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulrich Kautz: PHP Validation & Sanitization]]></title>
      <guid>http://www.phpdeveloper.org/news/18815</guid>
      <link>http://www.phpdeveloper.org/news/18815</link>
      <description><![CDATA[<p>
<i>Ulrich Kautz</i> has recently taken a look at <a href="http://foaa.de/blog/2012/11/27/php-validation-and-sanitization/">validation and sanitization</a> of data in PHP applications. He talks about several different methods - both in core PHP and in various frameworks.
</p>
<blockquote>
Validation and sanitization are extremely important topics, any developer should be aware of. Especially with powerful, modern frameworks, people seem to forget about the underlying concepts and wrongly assume it's already solved somehow. Correctly used and early on integrated, both play the central role in defending against attacks on your application.
</blockquote>
<p>
He talks a bit about why you should care about the topic, some of the common issues/threats that could come up because of it and some general information on what validation and sanitization are. He looks at implementation with the <a href="http://www.php.net/manual/en/intro.filter.php">filter extension</a> and touches on functionality from Symfony 2, Laravel 3, CakePHP 2 and shares <a href="https://github.com/fortrabbit/datafilter">his own data filtering module</a> with examples of its use.
</p>]]></description>
      <pubDate>Wed, 28 Nov 2012 11:57:35 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[David M&uuml;ller: Why URL validation with filter_var might not be a good idea]]></title>
      <guid>http://www.phpdeveloper.org/news/18498</guid>
      <link>http://www.phpdeveloper.org/news/18498</link>
      <description><![CDATA[<p>
<i>David M&uuml;ller</i> has a new post to his site today showing why <a href="http://www.d-mueller.de/blog/why-url-validation-with-filter_var-might-not-be-a-good-idea/">validating URLs with filter_var</a> is a good thing for the security of your application.
</p>
<blockquote>
Since PHP 5.2 brought us the filter_var function, the time of such [regular expressions-based] monsters was over. [With] the simple, yet effective syntax [and] with a third parameter, filter flags can be passed, [...] 4 flags are available [for URL filtering].
</blockquote>
<p>
He shows how to use it to filter out a simple <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">XSS</a> issue (a "script" tag in the URL) and some examples of issues that the <a href="http://php.net/filter_var">filter_var</a> function doesn't prevent - like injection of other schemes (like "php://" or "javascript://"). He recommends adding a wrapper around the method to check for the correct scheme (ex. "http" or "https" for URLs) and reminds you that filter_var is not multibyte capable.
</p>]]></description>
      <pubDate>Thu, 20 Sep 2012 08:09:31 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Build Web Apps From Scratch With Laravel: Filters, Validations, and Files]]></title>
      <guid>http://www.phpdeveloper.org/news/18305</guid>
      <link>http://www.phpdeveloper.org/news/18305</link>
      <description><![CDATA[<p>
NetTuts.com has posted the latest in their series about the <a href="http://laravel.com">Laravel</a> framework with <a href="http://net.tutsplus.com/tutorials/php/build-web-apps-from-scratch-with-laravel-filters-validations-and-files/">this new post</a>, a look at creating filters, validators and working with files.
</p>
<blockquote>
In this Nettuts+ <a href="http://net.tutsplus.com/tutorials/php/building-web-applications-from-scratch-with-laravel/">mini-series</a>, we'll build a web application from scratch, while diving into a great new PHP framework that's rapidly picking up steam, called <a href="http://laravel.com/">Laravel</a>. In this lesson, we'll be learning about some very useful Laravel features: filters, and both the validation and files libraries.
</blockquote>
<p>They continue improving their sample application ("Instapics") and show you how to:</p>
<ul>
<li>Create a filter to run before or after the request is handled
<li>Apply a set of validation rules to a given dataset
<li>Handle custom error messaging
<li>Work with local files and uploads
</ul>
<p>
They then take all of this and apply it to their application, creating an "auth" filter and login form, creating a form and doing some validation on its results and letting the user upload an image file.
</p>]]></description>
      <pubDate>Wed, 01 Aug 2012 13:55:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Input Validation Using Filter Functions]]></title>
      <guid>http://www.phpdeveloper.org/news/18038</guid>
      <link>http://www.phpdeveloper.org/news/18038</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a good tutorial that gives you some methods to do one of the most important things in any application - <a href="http://phpmaster.com/input-validation-using-filter-functions/">validating input</a>. Their examples show how to use some of PHP's own filter functions to accomplish this.
</p>
<blockquote>
Filter functions in PHP might not be sexy, but they can improve the stability, security, and even maintainability of your code if you learn how to use them correctly. In this article I'll explain why input validation is important, why using PHPs built-in functions for performing input validation is important, and then throw together some examples (namely using filter_input() and filter_var()), discuss some potential pitfalls, and finish with a nice, juicy call to action. 
</blockquote>
<p>
He talks about why validation is important to protect your application (and users) from malicious things like cross-site scripting. He emphasizes the use of PHP's own filter methods because they are established and, well, included in the language - no additional libraries needed. Example code is included showing how to use them to filter email addresses and check that something is an integer. 
</p>
<p>
You can find out more about these functions on their manual pages: <a href="http://php.net/filter_input"> filter_input</a>, <a href="http://php.net/filter_var">filter_var</a>.
</p>]]></description>
      <pubDate>Fri, 01 Jun 2012 15:53:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Seth May's Blog: The 5 Ws of Data Validation - Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17871</guid>
      <link>http://www.phpdeveloper.org/news/17871</link>
      <description><![CDATA[<p>
With a reminder about the best practice of always validating your data, <i>Seth May</i> has <a href="http://blog.sethmay.net/2012/04/the-5-ws-of-data-validation/">this new post</a> about the "Five Ws" of validation - why, when, where and who.
</p>
<blockquote>
As web developers, the applications you write are complex data processing engines.  They try and convince your users to enter good, meaningful data and to respond in solid, predictable ways based on what was entered. Robust data validation will allow the rest of you application to work effectively. [...] Data is scrutinized in various ways to make sure that it adheres to basic restrictions and to fundamental properties.  It's no good receiving a sandwich when you expect a car.
</blockquote>
<p>The questions he answers are:</p>
<ul>
<li>Why is Data Validation Important?
<li>Where Should I be Validating Data?
<li>When Should My Data Be Validated?
<li>Who is Responsible for Validation?
<li>How Do I Validate My Data? (yes, there's a "w" in there!)
</ul>
<blockquote>
In the real world data is ugly, crazy, and untrustworthy. Your only hope to taming the data beast is to diligently, methodically validate your data.
</blockquote>]]></description>
      <pubDate>Thu, 26 Apr 2012 11:14:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Refulz Blog: Yii Framework - Scenarios for Conditional Multiple Validation Rules]]></title>
      <guid>http://www.phpdeveloper.org/news/17857</guid>
      <link>http://www.phpdeveloper.org/news/17857</link>
      <description><![CDATA[<p>
On the Refulz blog there's a post showing you how to <a href="http://php.refulz.com/yii-framework-scenarios-for-conditional-multiple-validation-rules/">set up conditional multiple validation rules</a> in a Yii framework application.
</p>
<blockquote>
I am yet to write the last article of the <a href="http://php.refulz.com/series/sessions-in-yii/">Yii Session</a> series. I just decided to write something about the scenarios in the Validation feature of Yii framework. Scenarios are a very useful tool for adding different validations rules for different cases on the same model. In a real life situation, you would require one validation rule for user registration but the same rule might not be applicable to the User login. Scenarios help you define validation rules for different situations within same model.
</blockquote>
<p>
He shows you how to set up a "rules()" method in your model and a few validation configurations inside it - ensuring the password and email are set, checking the length of the password, etc. Then, by calling the "validate()" method on the model, you can easily apply these rules and check the pass/fail status.
</p>]]></description>
      <pubDate>Tue, 24 Apr 2012 09:18:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian G&ouml;ttschkes' Blog: Testclasses for symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/17815</guid>
      <link>http://www.phpdeveloper.org/news/17815</link>
      <description><![CDATA[<p>
<i>Sebastian G&ouml;ttschkes</i> has <a href="http://sgoettschkes.blogspot.com/2012/04/testclasses-for-symfony2.html">a new post to his blog</a> about a set of abstract base testing classes he's developed to help with the functional, unit and validation testing of his Symfony2-based applications.
</p>
<blockquote>
So, when developing with symfony2, I rely on my tests. They are my safety net and without them, I get a little nervous after every change. Does everything work? Did I forget anything? So I developed some classes which I extend. They work on top of PHPUnit and the symfony2 WebTestCase. The classes are used by my different types of Tests: UnitTests, ValidationTests, FunctionalTests (as well as IntegrationTests).
</blockquote>
<p>
Code for each type of testing base class is included in the post showing how he extends the based PHPUnit test case for unit testing and the Symfony WebTestCase for validation and functional testing. Each one of the classes are ready to use and give you some handy helper methods too. 
</p>]]></description>
      <pubDate>Fri, 13 Apr 2012 11:57:53 -0500</pubDate>
    </item>
  </channel>
</rss>
