Opened 11 years ago
Closed 11 years ago
#27225 closed defect (bug) (fixed)
Undefined index: error in wp-admin/includes/file.php on line 261
Reported by: | tivnet | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upload | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
$file['error']
might not be set.
Patch attached.
Attachments (1)
Change History (4)
#1
@
11 years ago
- Component changed from General to Upload
- Keywords has-patch commit added
- Milestone changed from Awaiting Review to 3.9
#2
@
11 years ago
Whatever they say, here is the error log from my PHP 5.4. I printed error_log(print_r($file, true));
[27-Feb-2014 20:37:40 UTC] PHP Notice: Undefined index: error in C:\......\wp-admin\includes\file.php on line 261 [27-Feb-2014 20:37:40 UTC] Array ( [name] => 20140227_203740_453_0_0_43051.zip [type] => application/force-download [size] => 271381 [tmp_name] => C:\tmp\php816F.tmp )
Note: See
TracTickets for help on using
tickets.
According to http://www.php.net/manual/en/features.file-upload.errors.php,
$_FILES['...']['error']
is always set, so apparently it can only be missing if it was removed inwp_handle_upload_prefilter
filter:tags/3.8.1/src/wp-admin/includes/file.php#L217.
We do, however, check if it's set in line 223 (added in [12142]), so we might as well do the same here.