News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

David Otton's Blog:
Stupid PHP Tricks Illegal Variable Names
August 22, 2008 @ 13:47:52

David Otton has shared another of his "stupid PHP tricks" on his blog today. This one looks at illegal variable names that don't match the "can't start with a number" rule the manual points out.

A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: '[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*'

Technically, you can get around this in two different ways - variable varaibles and the more complex notation with curly braces. He points to the compact function for proof that they're set.

0 comments voice your opinion now!
variable trick illegal name compact curlybrace


Stefan Esser's Blog:
What site do you want to break today?
June 18, 2007 @ 08:48:00

In a new post to the PHP Security Blog, Stefan Esser points out a recent commit to the PHP core as a fix to the session handling in PHP:

I just came back home and saw a very recent commit to PHP's session management. It is another attempt to fix the session cookie attribute injection that the PHP developers already tried to fix in PHP 5.2.3 without giving any credits. [...] their new fix that consists of blacklisting a bunch of legal characters from the session id, will most probably result in hundreds or thousands of broken sites.

Stefan points out that the fix blocks several valid characters that sites could potentially use in their session IDs, and that with this new code in place, it could drastically effect those site's functionality.

As of the time of this post, however, it seems that the issue has been recognized and corrected so as not to cause the above mentioned issue in future updates.

0 comments voice your opinion now!
session bugfix commit illegal character session bugfix commit illegal character



Community Events











Don't see your event here?
Let us know!


overview release hack framework support code facebook unittest install security symfony2 podcast package composer component opinion language hhvm application introduction

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework