216 reputation
13
bio website allegro.cc
location Illinois
age 33
visits member for 4 years, 3 months
seen Sep 3 at 16:40
Hi.

Dec
9
awarded  Nice Answer
Sep
9
awarded  Yearling
May
15
awarded  Teacher
May
14
comment Directly modifying superglobals
@Wesley, the primary reason it is "bad" is that it makes it much more likely that you'll forget to sanitize some user data. In your example, you modify one key then pass the entire array. What if some of that data contains malicious input that is not processed? It's much better to build that new array by hand, copying only the things you need from $_POST into it, sanitizing as you go along. And regarding other people doing this... well, a lot of people write very bad PHP code, but that's no excuse for you to as well. :)
May
13
answered Directly modifying superglobals
Sep
26
awarded  Autobiographer