Skip to content

Commit

Permalink
Fix bug in request processing where formdata has nested array. ref #11
Browse files Browse the repository at this point in the history
  • Loading branch information
fundead committed Oct 16, 2013
1 parent 502aa2c commit 84b6d4b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Raygun4php/RaygunRequestMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ public function __construct()
}

$this->headers = $this->emu_getAllHeaders();
$this->data = $_SERVER;
$this->form = array_map(
function($str) {
return iconv('UTF-8', 'UTF-8//IGNORE', $str);
},
$_POST
);
$this->data = $_SERVER;

$utf8_convert = function($value) use (&$utf8_convert) {
return is_array($value) ?
array_map($utf8_convert, $value) :
iconv('UTF-8', 'UTF-8//IGNORE', $value);
};
$this->form = array_map($utf8_convert, $_POST);

if (php_sapi_name() !== 'cli' &&
$_SERVER['REQUEST_METHOD'] != 'GET' &&
Expand Down

0 comments on commit 84b6d4b

Please sign in to comment.