ZF-170 (is assigned to me) addresses this issue through the use of SPL's iterator (i thought arrayaccess was already implemented but if its not i'll add that support at the same time)

If someone wants to take this over, i'd be happy to defer as im way behind on my latest fw patch set.

Once done, you'll be able to use zfi objects as you would an array anyway. The biggest problem is determining what rule is applied by default. ZFI destroys the input array for a reason, that is to prevent access to unfiltered data. Array access methods will require some type of default (getRaw/addslashes maybe?) but this could cause a bad use-case where inexperienced devs use the array key value thinking its safe when its not and cause an end-run around this crucial zfi security feature.

Comments?

Kevin McArthur
----- Original Message ----- From: "gonyuu" <[EMAIL PROTECTED]>
To: <fw-general@lists.zend.com>
Sent: Monday, October 09, 2006 8:47 PM
Subject: [fw-general] Zend_Filter_Input, toArray() method



This is a small idea, but wouldn't a toArray() be pertinent for the
Zend_Filter_Input class, especially since Zend_Filter_Input destroys its
source? I very much appreciate the filtering methods available through
Zend_Filter_Input, but sometimes I find that an array() structure would be
convenient (for looping, especially).

public function toArray()
{
   return $this->_source;
}

use case:

foreach($zendFilter->toArray() as $key) {
   echo $zendFilter->getAlnum($key);
}

Thanks, gonyuu
--
View this message in context: http://www.nabble.com/Zend_Filter_Input%2C-toArray%28%29-method-tf2414124s16154.html#a6729283
Sent from the Zend Framework mailing list archive at Nabble.com.


Reply via email to