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

MaltBlue.com:
Painless Data Traversal with PHP FilterIterators
Oct 25, 2012 @ 13:54:35

On the MaltBlue blog Matt Setter has a new post introducing you to using FilterIterators for data traversal:

There’s load of ways to traverse data, especially in PHP where there are a variety of loops available; including while, do while, for and foreach. These are fine for normal structures, such as scalar and associative arrays. But what if you want to get a bit more fancy?

He includes a bit of code showing the typical looping approach that a lot of developers take and how, using a FilterIterator, you can extend the default and make a custom "accept" method to remove certain matching items from the data set.

tagged: filteriterator data traversal filter spl iterator array

Link:

Secunia.com:
CodeIgniter Weakness and Directory Traversal Vulnerability
Jul 11, 2007 @ 16:07:00

On the Secunia.com site today, there's a new vulnerability posted that users of the CodeIgniter framework should pay attention to - a "weakness and directory traversal vulnerability".

Lukasz Pilorz has reported a vulnerability and a weakness in CodeIgniter, which can be exploited by malicious people to disclose sensitive information and conduct cross-site scripting and header injection attacks.

There are two problems that lead to this issue - a non-sanitized input parameter and unsanitized data being passed to the xss_clean function. These issues affect CodeIgniter version 1.5.3 and, as of the time of this post, no update has been made in an official release. It is mentioned, however, that the problem has been fixed in the CVS and is waiting for a release.

tagged: codeigniter weakness directory traversal vulnerability framework codeigniter weakness directory traversal vulnerability framework

Link:

Secunia.com:
CodeIgniter Weakness and Directory Traversal Vulnerability
Jul 11, 2007 @ 16:07:00

On the Secunia.com site today, there's a new vulnerability posted that users of the CodeIgniter framework should pay attention to - a "weakness and directory traversal vulnerability".

Lukasz Pilorz has reported a vulnerability and a weakness in CodeIgniter, which can be exploited by malicious people to disclose sensitive information and conduct cross-site scripting and header injection attacks.

There are two problems that lead to this issue - a non-sanitized input parameter and unsanitized data being passed to the xss_clean function. These issues affect CodeIgniter version 1.5.3 and, as of the time of this post, no update has been made in an official release. It is mentioned, however, that the problem has been fixed in the CVS and is waiting for a release.

tagged: codeigniter weakness directory traversal vulnerability framework codeigniter weakness directory traversal vulnerability framework

Link:

David Sklar's Blog:
Speed - DOM traversal vs. XPath in PHP 5
Feb 23, 2006 @ 12:43:03

On his blog today, David Sklar has this new post that compares the speed of two methods of grabbing info from an XML document in PHP5 - DOM traversal versus XPath.

Needing to pick out some bits from a smallish (40 lines) XML document studded with namespaces, I first turned to DomXPath. Worked great, code's concise, XPath expression is simple. But I had the nagging thought that using DOM traversal functions should be faster.

The results from his test? The DOM traversal is about four times faster than using XPath to achieve the same thing.

That 4x speed multiple translates into about a half second to execute for the XPath code and about 0.13 seconds to execute for the DOM code when each is run 10,000 times. Since a typical use of this code will involve it running maybe 10 or 20 times during a request, I'm happy to sacrifice a few microseconds of processor time in exchange for simpler code.

tagged: speed xml parse dom traversal xpath php5 speed xml parse dom traversal xpath php5

Link:

David Sklar's Blog:
Speed - DOM traversal vs. XPath in PHP 5
Feb 23, 2006 @ 12:43:03

On his blog today, David Sklar has this new post that compares the speed of two methods of grabbing info from an XML document in PHP5 - DOM traversal versus XPath.

Needing to pick out some bits from a smallish (40 lines) XML document studded with namespaces, I first turned to DomXPath. Worked great, code's concise, XPath expression is simple. But I had the nagging thought that using DOM traversal functions should be faster.

The results from his test? The DOM traversal is about four times faster than using XPath to achieve the same thing.

That 4x speed multiple translates into about a half second to execute for the XPath code and about 0.13 seconds to execute for the DOM code when each is run 10,000 times. Since a typical use of this code will involve it running maybe 10 or 20 times during a request, I'm happy to sacrifice a few microseconds of processor time in exchange for simpler code.

tagged: speed xml parse dom traversal xpath php5 speed xml parse dom traversal xpath php5

Link:


Trending Topics: