Skip to content

Commit

Permalink
thusfar
Browse files Browse the repository at this point in the history
  • Loading branch information
bobmagicii committed Jun 22, 2024
1 parent 1121600 commit 053952a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Nether/Avenue/Struct/FormData.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,40 @@ protected function
continue;
}

$this->Fields = $this->ParseRawInputExpandFields();

return;
}

protected function
ParseRawInputExpandFields():
Common\Datastore {

$Output = [];
$Key = NULL;
$Val = NULL;
$Found = NULL;

foreach($this->Fields as $Key => $Val) {

if(preg_match('/^(.+?)\[(.+?)\]$/', $Key, $Found)) {
if(!array_key_exists($Found[1], $Output))
$Output[$Found[1]] = [];

$Output[$Found[1]][$Found[2]] = $Val;
continue;
}

$Output[$Key] = $Val;
continue;
}

//Common\Dump::Var($this->Fields);
//Common\Dump::Var($Output);

return Common\Datastore::FromArray($Output);
}

public function
ParseRequestHeaders(string $Input):
Common\Datastore {
Expand Down

0 comments on commit 053952a

Please sign in to comment.