<?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>Thu, 23 May 2013 05:00:13 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mike Dalisay: Salt, Hash and Store Passwords Securely with Phpass]]></title>
      <guid>http://www.phpdeveloper.org/news/19427</guid>
      <link>http://www.phpdeveloper.org/news/19427</link>
      <description><![CDATA[<p>
On <i>Mike Dalisay</i>'s site there's a recent post showing how to use the <a href="http://www.openwall.com/phpass/">Phpass</a> tool to <a href="http://www.codeofaninja.com/2013/03/php-hash-password.html#.UVziYKUm0sc.dzone">salt, hash and store passowrd data</a> in your application.
</p>
<blockquote>
I think the main reason why we have to hash passwords is to prevent passwords from being stolen or compromised. You see, even if someone steal your database, they will never read your actual or cleartext password. I know that some PHP frameworks or CMS already provide this functionality, but I believe that it is important for us to know how its implementation can be made.
</blockquote>
<p>
His <a href="https://docs.google.com/file/d/0B-AInNrVeucKZGgzWThFdUNhNVk/edit?usp=sharing">sample application</a> stores the user data in a MySQL database and does the salting+hashing at the time of the request. It uses a hard-coded salt and a value of 8 for the hashing/stretching.  Screenshots of each page in the example application are also included.
</p>
Link: http://www.codeofaninja.com/2013/03/php-hash-password.html#.UVziYKUm0sc.dzone]]></description>
      <pubDate>Mon, 08 Apr 2013 12:16:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Creating a PHP OAuth Server]]></title>
      <guid>http://www.phpdeveloper.org/news/18976</guid>
      <link>http://www.phpdeveloper.org/news/18976</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's <a href="http://phpmaster.com/creating-a-php-oauth-server/">a new tutorial posted</a> about creating your own OAuth server in PHP using the <a href="http://code.google.com/p/oauth-php/">oauth-php package</a> to do the "heavy lifting".
</p>
<blockquote>
If you've ever integrated with another API that requires security (such as Twitter), you've probably consumed an OAuth service. In this article, I'll explore what it takes to create your own three-legged OAuth server allowing you, for example, to create your own secure API which you can release publicly.
</blockquote>
<p>
They include a <a href="http://cdn.phpmaster.com/files/2012/12/diagram.png">visual representation</a> of the OAuth authentication flow (it's not the simplest thing) and the database structure/sample code you'll need to get the server up and listening. Also included is a registration form and how to generate a request token and give back an access token. There's also some sample code showing how to validate the request and it's access token to check for a correct (and allowed) request.
</p>]]></description>
      <pubDate>Tue, 01 Jan 2013 11:56:46 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: Protecting against attack?]]></title>
      <guid>http://www.phpdeveloper.org/news/17978</guid>
      <link>http://www.phpdeveloper.org/news/17978</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/tnval/protecting_against_attack/">this recent post</a> to Reddit.com, the question of application security is asked - the poster wants recommendations on how he should keep his app safe from would-be attackers:
</p>
<blockquote>
I can code fairly well in PHP these days, but my security isn't so hot. Is there a tutorial or plugin you guys can recommend as to how I should be protecting my php pages/inputs? I want to avoid common attacks like XSS, inputs with NULL or DROP TABLE etc?
</blockquote>
<p>
Responses <a href="http://www.reddit.com/r/PHP/comments/tnval/protecting_against_attack/">on the post</a> include recommendations related to:
</p>
<ul>
<li>Using the <a href="https://chorizo-scanner.com/">Chorizo scanner</a> to find common issues in your code
<li>Using PDO for database connections (with bound parameters)
<li>Not trusting "$_SERVER" 
<li>Data sanitization
</ul>
<p>
There's also links to <a href="http://phpmaster.com/php-security-cross-site-scripting-attacks-xss/">a few</a> <a href="https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API">other</a> <a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454">resources</a> with more details.
</p>]]></description>
      <pubDate>Fri, 18 May 2012 10:19:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: PHP Security: Cross-Site Scripting Attacks (XSS)]]></title>
      <guid>http://www.phpdeveloper.org/news/17890</guid>
      <link>http://www.phpdeveloper.org/news/17890</link>
      <description><![CDATA[<p>
PHPMaster.com has a new tutorial posted today (by <i>George Fekete</i>) about <a href="http://phpmaster.com/php-security-cross-site-scripting-attacks-xss/">preventing cross-site scripting attacks</a> in your PHP-based applications.
</p>
<blockquote>
Unfortunately, cross-site scripting attacks occurs mostly, because developers are failing to deliver secure code. Every PHP programmer has the responsibility to understand how attacks can be carried out against their PHP scripts to exploit possible security vulnerabilities. Reading this article, you'll find out more about cross-site scripting attacks and how to prevent them in your code.
</blockquote>
<p>
Included in the tutorial is an example with a simple form and definitions of different types of XSS attacks - reflected XSS, persistent XSS and three ways to prevent them: data filtering, output filtering and data validation. He also links to a few "cheatsheets" to help even more (including <a href="http://ha.ckers.org/xss.html">this guide</a> and a Zend Framework set of <a href="http://www.zfsnippets.com/snippets/view/id/5">XSS test data</a>.
</p>]]></description>
      <pubDate>Tue, 01 May 2012 11:59:28 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Stuart Herbert's Blog: ContractLib - An Introduction & Comparing it to PHP's Assert]]></title>
      <guid>http://www.phpdeveloper.org/news/17405</guid>
      <link>http://www.phpdeveloper.org/news/17405</link>
      <description><![CDATA[<p>
<i>Stuart Herbert</i> has two new posts to his blog showing how to use the <a href="https://github.com/stuartherbert/ContractLib">ContractLib</a> tool he's created to define programming "contracts". In <a href="http://blog.stuartherbert.com/php/2012/01/16/getting-started-with-contractlib/">the first</a> he shows some sample usage of the tool and in <a href="http://blog.stuartherbert.com/php/2012/01/17/comparing-contractlib-to-phps-built-in-assert/">the second</a> he compares the functionality of ContractLib's features and PHP's own "<a href="http://us3.php.net/assert">assert</a>" method.
</p>
<blockquote>
<a href="https://github.com/stuartherbert/ContractLib">ContractLib</a> is a simple-to-use PHP component for easily enforcing programming contracts throughout your PHP components. These programming contracts can go a long way to helping you, and the users of your components, develop more robust code.
</blockquote>
<p>
In <a href="http://blog.stuartherbert.com/php/2012/01/16/getting-started-with-contractlib/">his example tests</a> he shows how to set a pre-condition on a method's input ensuring that it will always be the correct datatype (array). In <a href="http://blog.stuartherbert.com/php/2012/01/17/comparing-contractlib-to-phps-built-in-assert/">his comparison</a> with PHP's "assert", he lists out some of the features that either one has and notes that ContractLib allows you to be much more flexible with your checking than just simple statements.
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 10:58:38 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DeveloperDrive.com: What Web Developers Need to Know About Cross-Site Scripting]]></title>
      <guid>http://www.phpdeveloper.org/news/17002</guid>
      <link>http://www.phpdeveloper.org/news/17002</link>
      <description><![CDATA[<p>
On the DeveloperDrive.com site there's a recent post anyone wondering about cross-site scripting should give a read. They <a href="http://www.developerdrive.com/2011/10/what-web-developers-need-to-know-about-cross-site-scripting/">introduce you to the basic concept</a> and two things you can do to help prevent them.
</p>
<blockquote>
This little fable describes the most common vulnerability found in web sites, the Cross Site Scripting (XSS) attack. According to a report from <a href="http://www.darkreading.com/security/app-security/showArticle.jhtml?articleID=221601529">WhiteHat Security</a> 83 percent of websites they tested have had at least one serious vulnerability and 66 percent of all websites with vulnerabilities are susceptible to XSS attacks making it the most common vulnerability web developers face. To fix this, it takes 67 days on average. Tools like <a href="http://www.owasp.org/index.php/Main_Page">WebScarab</a> and <a href="http://www.parosproxy.org/index.shtml">Paros Proxy</a> can be used to scan sites for possible vulnerabilities.
</blockquote>
<p>
They offer two simple pieces of advice that it's all too easy to forget when developing applications - validate all user input to ensure it's what it should be and escape any untrusted output (even sometimes your own!) before pushing it out to the page.
</p>]]></description>
      <pubDate>Mon, 17 Oct 2011 13:39:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[SkyTechGeek.com: 10 Exceptional Tools For Website Testing]]></title>
      <guid>http://www.phpdeveloper.org/news/16760</guid>
      <link>http://www.phpdeveloper.org/news/16760</link>
      <description><![CDATA[<p>
Sometimes a little (external) testing of your website is in order and <i>Gagan Chhatwal</i> has posted <a href="http://skytechgeek.com/2011/08/10-exceptional-tools-for-website-testing/">his list of ten tools</a> you can use to check everything from  how much load the site can take to what can be done to optimize the load time.
</p>
<blockquote>
When maintaining or running a website , Webmasters need to keep in mind that one of the pertinent issues they will need to focus on is :Website Testing, which is not only vital for the website itself but for the user as well and one should not overlook its importance. [We have] collected some vital and free website testing tools which will help Webmasters in testing their sites thus saving users to conduct time consuming needless searches in finding the best resources pertaining to Web related tools and info.
</blockquote>
<p>Among the tools on the list are services like:</p>
<ul>
<li><a href="http://loadimpact.com/">Load Impact</a>
<li><a href="https://browsermob.com/performance-testing">Browser Mob</a>
<li><a href="http://host-tracker.com/">Host Tracker</a>
<li><a href="http://builtwith.com/">Built With</a>
<li><a href="http://online.htmlvalidator.com/php/onlinevallite.php">CSE HTML validator</a>
</ul>
<p>
Most of these resources are free services, if not then they have a trial where you can see if it's a good fit.
</p>]]></description>
      <pubDate>Tue, 23 Aug 2011 13:25:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Court Ewing's Blog: Create and Validate a Choice List in a Symfony 2 Form]]></title>
      <guid>http://www.phpdeveloper.org/news/16728</guid>
      <link>http://www.phpdeveloper.org/news/16728</link>
      <description><![CDATA[<p>
<i>Court Ewing</i> has written up a new post to his blog about <a href="http://epixa.com/2011/08/create-and-validate-a-choice-list-in-a-symfony-2-form">creating a "choice" list</a> (a select list as defined by Symfony 2) with dynamic options and validating the resulting submission. His example uses Doctrine 2 entities to work with most of the data handling.
</p>
<blockquote>
A standard select list can be created using Symfony's choice field type; it is pretty clear how to create a new <a href="http://symfony.com/doc/current/reference/forms/types/choice.html">choice</a> field with simple, non-dynamic options (e.g. gender), but it gets a little more complicated when you want to create and validate a dynamically generated choice list.
</blockquote>
<p>
He includes the code for a simple entity, a Post model to fetch the category information and the set up of the form element - a select list of post types/categories. He also includes a bonus section showing how you can achieve the same thing without a model to bind to. 
 The code's a little bit more complex than the previous example, but it's basically just reproducing some of the validation and fetching logic manually.
</p>]]></description>
      <pubDate>Wed, 17 Aug 2011 08:28:21 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zoomzum Blog: 10 Powerful PHP Regular Expression For Developers]]></title>
      <guid>http://www.phpdeveloper.org/news/16639</guid>
      <link>http://www.phpdeveloper.org/news/16639</link>
      <description><![CDATA[<p>
On the Zoomzum blog there's a new post with <a href="http://zoomzum.com/10-powerful-php-regular-expression-for-developers/">ten regular expressions</a> PHP developers can use to accomplish some common tasks (like email validation and date formatting checks).
</p>
<blockquote>
Regular expression for the PHP developers, on of the most popular tool for validating data is the regular expression. In this list we provides some validation - string match, password match validation, email address validation, date format and many more which helps developer to make their application more fast and easy to execute. [...] Have you note that, regular expressions are more slower than the basic string function, its takes a short time to execute than any others.
</blockquote>
<p>Included in their list are things like:</p>
<ul>
<li>Password Match Validation
<li>Validate URL
<li>Validate  URL using Preg_match
<li>UK Postcode Validation
<li>SSN,ISBN and Zipcode Validation
</ul>
<p>
A few of these could be done with either one or two string calls or some of the filtering functions that are included in PHP.
</p>]]></description>
      <pubDate>Wed, 27 Jul 2011 09:02:10 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Validating dates]]></title>
      <guid>http://www.phpdeveloper.org/news/15405</guid>
      <link>http://www.phpdeveloper.org/news/15405</link>
      <description><![CDATA[<p>
In a new Zend Framework related post to his blog today <i>Rob Allen</i> takes a look at <a href="http://akrabat.com/zend-framework/validating-dates/">a different operating mode he found with Zend_Date</a> changing how it handles format specifiers.
</p>
<blockquote>
I discovered recently that Zend Framework 1's Zend_Date has two operating modes when it comes to format specifiers: iso and php, where iso is the default. When using Zend_Validate_Date in forms, I like to use the php format specifiers as they are what I'm used to and so can easily know what they mean when reviewing code that I wrote months ago.
</blockquote>
<p>
His example code shows how you can use the standard <a href="http://php.net/date">date</a> formatting strings in a Zend_Form validator (the "php" format) and an example using the Zend_Date::MONTH or Zend_Date::YEAR identifiers (the "iso" format). He also shows how he met two other requirements - validation for empty and a consistent format on the date validation ("Y-m-d").
</p>]]></description>
      <pubDate>Tue, 09 Nov 2010 12:11:12 -0600</pubDate>
    </item>
  </channel>
</rss>
