Make WordPress Core

Ticket #27225: file-php--if-file-error.patch

File file-php--if-file-error.patch, 854 bytes (added by tivnet, 11 years ago)
  • wp-admin/includes/file.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    258258                return call_user_func($upload_error_handler, $file, __( 'Invalid form submission.' ));
    259259
    260260        // A successful upload will pass this test. It makes no sense to override this one.
    261         if ( $file['error'] > 0 )
    262                 return call_user_func($upload_error_handler, $file, $upload_error_strings[$file['error']] );
     261        if ( isset( $file['error'] ) && $file['error'] > 0 ) {
     262                return call_user_func( $upload_error_handler, $file, $upload_error_strings[$file['error']] );
     263        }
    263264
    264265        // A non-empty file will pass this test.
    265266        if ( $test_size && !($file['size'] > 0 ) ) {