[TYPO3-dev] Bug/Feature request for t3lib_div::_GP (and alike)
Franz Koch
typo.removeformessage at fx-graefix.de
Fri Jun 6 15:12:21 CEST 2008
Hey,
>> No, I'd like those methods to use a merged _GET/_POST array for
>> returning their results, coming from t3lib_div::GParrayMerged,
>> returning array (where _POST is overriding _GET(!)) instead of the
>> lousy if-condition there.
>
> ??? The condition does for *one* requested value exactly the same as an
> array merging functions does for all keys. I don't get your point.
I check for a 'subkey' in a multidimensional _GET-array.
I understood using the condition 'globalVar =
GP:my_extension_designator|subkey' as a check, if the given parameter is
present in either _GET or _POST - with priority to _POST. That's how it
is currently, and that's fine as long as you only have either _GET or
_POST values from the same extension submitted. If you have both kinds
with a _GET/_POST-key holding another array (like it's done for
extensions/piVars) at the same time and the value you check for is
currently in _GET, then the condition fails because t3lib_div::_GP will
only check in the _POST array, as there is a result for the searched
extension designator - although there is no result for the searched
subkey. Hope my point is a bit more clearly now.
So I thought instead of using multiple conditions checking for either
_GET or _POST, the condition GP should check in a merged array from
BOTH, where _POST is overriding values from _GET recursively for
security reasons. And for that, the method
t3lib_div::GParrayMerged($key) could be used, because it's merging _GET
and _POST like needed and is ultimately returning the result of desired
key that can be used for further processing (stripping, etc.).
Besides of the TS-conditions, I currently don't see a benefit from
returning only _GET or _POST in t3lib_div::_GP although it's documented
like that. What was the initial idea behind this behavior? What's a real
life use case where exactly this behavior is needed and where the result
can't be a merged array from _GET and _POST? The overall result would be
the same, except that in some cases you get more sub-keys/values
returned and that multidimensional arrays get correctly processed.
--
kind regards,
Franz Koch
More information about the TYPO3-dev
mailing list