On Tue, Nov 25, 2008 at 2:50 PM, Sean Coates <[EMAIL PROTECTED]> wrote:
>
>> One other note: The $_POST/$_GET etc. are not actually arrays anymore,
>> so if you want an array for things like array_map or other array
>> functions you can use the ArrayObject method $_POST->getArrayCopy()
>
> True, though I'd strongly advise against this when writing new code,
> as it essentially bypasses the protections put in place by the
> SuperGlobal stuff.
>
> See 
> http://trac.habariproject.org/habari/changeset/2873/trunk/htdocs/system/classes/installhandler.php
>  for (IMO) a good example of how to properly handle this.

Using ArrayObject->getArrayCopy() or foreach( ArrayObject ) produces
the same result, as ArrayObject does not implement an Iterator
directly.

Rev 2887 makes SuperGlobal extend ArrayIterator instead of
ArrayObject, so the example mentioned above will use the filtered
(safe) data. Also it overloads getArrayCopy so that a filtered (safe)
array is returned (although, not recomended for consumption since it
could slow things down).


-- 
Matt Read
http://mattread.com

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to