diff options
Diffstat (limited to 'framework/Web/THttpRequest.php')
-rw-r--r-- | framework/Web/THttpRequest.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 5ec09fc9..bf0ede17 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -163,8 +163,20 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar $getVariables=array();
for($i=0;$i<$n;++$i)
{
- if($i+1<$n)
- $getVariables[$paths[$i]]=$paths[++$i];
+ if($i+1<$n) {
+ $varName = $paths[$i];
+ $varVal = $paths[++$i];
+ if (strpos($varName, '[]') == strlen($varName)-2) {
+ $varName = substr($varName,0, strpos($varName, '[]'));
+ if (isset($getVariables[$varName])) {
+ $getVariables[$varName][] = $varVal;
+ } else {
+ $getVariables[$varName] = array($varVal);
+ }
+ } else {
+ $getVariables[$varName]=$varVal;
+ }
+ }
}
$this->_items=array_merge($getVariables,array_merge($_GET,$_POST));
}
|