[wp-trac] [WordPress Trac] #22325: Abstract GPCS away from the superglobals
WordPress Trac
noreply at wordpress.org
Fri Nov 2 17:58:28 UTC 2012
#22325: Abstract GPCS away from the superglobals
-------------------------+-----------------------------
Reporter: rmccue | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: General | Version:
Severity: minor | Resolution:
Keywords: |
-------------------------+-----------------------------
Comment (by CaptainN):
Another way to reduce validation boilerplate is to use a system like
WP_OnceForm, which polyfills the missing values. OnceForm starts from the
HTML form, so it knows up front which name/value pairs will need to be
filled in.
The php GPCS system is different, it just deals with whatever is sent to
the server without referencing anything else, so if the scope will be
limited in the same way as PHP's GPCS system, some query methods to check
for missing items as MikeSchinkel described makes sense (they even make
sense for dealing with the standard PHP superglobals).
A comment on that implementation though - I'd prefer lower case function
names (_get, _post, _request) to uppercase, because I think if these are
lower case, it'll be less likely to be confused with the real superglobals
at a glance.
Maybe this is less of an issue, but I'd also like to see little else other
than a wrapper around the actual superglobals. In other words, it should
behave pretty much exactly as the PHP standard on which it's based. The
headache with the current system (especially when you are first getting
started) is that WordPress's model differs from PHP in a couple of
substantial (magic-quotes), and some less substantial (the way the GPCS
vars are mixed) ways, which causes a lot of problems before you find out
what WordPress is doing in there, and here's a change to fix that.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22325#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list