_REQUEST and addslashes questions

8 views
Skip to first unread message

Hermann Kaser

unread,
Sep 16, 2008, 8:07:33 AM9/16/08
to ins...@googlegroups.com
Hello,

I've recently started using Inspekt on a project I work for and have
run into a couple of issues:

1. I prefer to have GET and POST variables accessible from one point
rather than have to explicitly choose which one I want to use, is
there any reason why there isn't a cage available for the _REQUEST
array?. I just copy and pasted the makePostCage and did
s/POST/REQUEST/g, may i suggest this method be included in the
repository?

2. I've noticed a lack of addslashes, is there a way to automatically
addslash all variables or a addslashes method?

--
Hermann Käser
http://theragingche.com/
http://semicir.cl/user/hermzz

Ed Finkler

unread,
Sep 17, 2008, 6:20:57 PM9/17/08
to ins...@googlegroups.com
On Tue, Sep 16, 2008 at 8:07 AM, Hermann Kaser <herman...@gmail.com> wrote:
> Hello,
>
> I've recently started using Inspekt on a project I work for and have
> run into a couple of issues:
>
> 1. I prefer to have GET and POST variables accessible from one point
> rather than have to explicitly choose which one I want to use, is
> there any reason why there isn't a cage available for the _REQUEST
> array?. I just copy and pasted the makePostCage and did
> s/POST/REQUEST/g, may i suggest this method be included in the
> repository?

Basically, the reason is that I think it's important to deal with GET
and POST individually. It's important, I believe, to be aware of
*where* your input is coming from, as that will frequently affect how
you handle it. You can wrap *any* array in a cage using the
Inspekt_Cage::Factory() method:

http://funkatron.com/inspekt/user_docs/#Filtering-non-superglobal-arrays

But this would not work if you have already unset $_REQUEST by
instantiating a SuperCage.


> 2. I've noticed a lack of addslashes, is there a way to automatically
> addslash all variables or a addslashes method?

No, can you add an issue for this? I can see the attraction.

--
Ed Finkler
http://funkatron.com
AIM: funka7ron
ICQ: 3922133
Skype: funka7ron

Reply all
Reply to author
Forward
0 new messages