Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix 0'th index file not being copied to $_FILES.

Fixes #3256
  • Loading branch information...
commit 1110e26483fd0c509b10b096d414ed82004965c0 1 parent 8800d7b
@markstory markstory authored
View
2  lib/Cake/Network/CakeRequest.php
@@ -319,7 +319,7 @@ protected function _base() {
protected function _processFiles() {
if (isset($_FILES) && is_array($_FILES)) {
foreach ($_FILES as $name => $data) {
- if ($name != 'data') {
+ if ($name !== 'data') {
$this->params['form'][$name] = $data;
}
}
View
18 lib/Cake/Test/Case/Network/CakeRequestTest.php
@@ -588,6 +588,24 @@ public function testFilesParsing() {
}
/**
+ * Test that files in the 0th index work.
+ */
+ public function testFilesZeroithIndex() {
+ $_FILES = array(
+ 0 => array(
+ 'name' => 'cake_sqlserver_patch.patch',
+ 'type' => 'text/plain',
+ 'tmp_name' => '/private/var/tmp/phpy05Ywj',
+ 'error' => 0,
+ 'size' => 6271,
+ ),
+ );
+
+ $request = new CakeRequest('some/path');
+ $this->assertEquals($_FILES, $request->params['form']);
+ }
+
+/**
* test method overrides coming in from POST data.
*
* @return void
Please sign in to comment.
Something went wrong with that request. Please try again.