From 2cac4c811d5e7f278d4fa24239cda47b984f15ca Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 14 Jan 2017 13:44:57 -0500 Subject: Add workaround when IE11 submit corrupted multipart/form-data --- app/Core/Http/Request.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/Core/Http') diff --git a/app/Core/Http/Request.php b/app/Core/Http/Request.php index 2e84958d..44bfdbe6 100644 --- a/app/Core/Http/Request.php +++ b/app/Core/Http/Request.php @@ -105,7 +105,7 @@ class Request extends Base { if (! empty($this->post) && ! empty($this->post['csrf_token']) && $this->token->validateCSRFToken($this->post['csrf_token'])) { unset($this->post['csrf_token']); - return $this->post; + return $this->filterValues($this->post); } return array(); @@ -344,4 +344,17 @@ class Request extends Base { return isset($this->server[$variable]) ? $this->server[$variable] : ''; } + + protected function filterValues(array $values) + { + foreach ($values as $key => $value) { + + // IE11 Workaround when submitting multipart/form-data + if (strpos($key, '-----------------------------') === 0) { + unset($values[$key]); + } + } + + return $values; + } } -- cgit v1.2.3