mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
parent
8800d7bdec
commit
1110e26483
2 changed files with 19 additions and 1 deletions
|
@ -319,7 +319,7 @@ class CakeRequest implements ArrayAccess {
|
|||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -587,6 +587,24 @@ class CakeRequestTest extends CakeTestCase {
|
|||
$this->assertEquals($request->params['form'], $_FILES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue