PHPCS: Fix formatting issues.

Fixes formatting issues introduced in [44438].

See #45615.


git-svn-id: https://develop.svn.wordpress.org/trunk@44441 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe McGill 2019-01-07 21:08:03 +00:00
parent 5aa0b178e1
commit 843111a03b
2 changed files with 21 additions and 15 deletions

View File

@ -2574,23 +2574,29 @@ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
}
} elseif ( 'text/plain' === $real_mime ) {
// A few common file types are occasionally detected as text/plain; allow those.
if ( ! in_array( $type, array(
if ( ! in_array(
$type,
array(
'text/plain',
'text/csv',
'text/richtext',
'text/tsv',
'text/vtt',
) )
)
)
) {
$type = $ext = false;
}
} elseif( 'text/rtf' === $real_mime ) {
} elseif ( 'text/rtf' === $real_mime ) {
// Special casing for RTF files.
if ( ! in_array( $type, array(
if ( ! in_array(
$type,
array(
'text/rtf',
'text/plain',
'application/rtf',
) )
)
)
) {
$type = $ext = false;
}

View File

@ -1341,8 +1341,8 @@ class Tests_Functions extends WP_UnitTestCase {
DIR_TESTDATA . '/export/crazy-cdata.xml',
'crazy-cdata.jpg',
array(
'ext' => false,
'type' => false,
'ext' => false,
'type' => false,
'proper_filename' => false,
),
),
@ -1351,8 +1351,8 @@ class Tests_Functions extends WP_UnitTestCase {
DIR_TESTDATA . '/export/crazy-cdata.xml',
'crazy-cdata.doc',
array(
'ext' => false,
'type' => false,
'ext' => false,
'type' => false,
'proper_filename' => false,
),
),
@ -1361,8 +1361,8 @@ class Tests_Functions extends WP_UnitTestCase {
DIR_TESTDATA . '/uploads/test.vtt',
'test.vtt',
array(
'ext' => 'vtt',
'type' => 'text/vtt',
'ext' => 'vtt',
'type' => 'text/vtt',
'proper_filename' => false,
),
),
@ -1370,8 +1370,8 @@ class Tests_Functions extends WP_UnitTestCase {
DIR_TESTDATA . '/uploads/test.csv',
'test.csv',
array(
'ext' => 'csv',
'type' => 'text/csv',
'ext' => 'csv',
'type' => 'text/csv',
'proper_filename' => false,
),
),
@ -1380,8 +1380,8 @@ class Tests_Functions extends WP_UnitTestCase {
DIR_TESTDATA . '/uploads/test.rtf',
'test.rtf',
array(
'ext' => 'rtf',
'type' => 'application/rtf',
'ext' => 'rtf',
'type' => 'application/rtf',
'proper_filename' => false,
),
),