Properly name files with unknown extensions (for people with unfiltered_upload cap, natch). props Nazgul. fixes #4974 for trunk
git-svn-id: https://develop.svn.wordpress.org/trunk@6116 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
f372b1dd05
commit
a18368bf3f
|
@ -140,7 +140,7 @@ function wp_handle_upload( &$file, $overrides = false ) {
|
||||||
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
|
return $upload_error_handler( $file, __( 'File type does not meet security guidelines. Try another.' ));
|
||||||
|
|
||||||
if ( !$ext )
|
if ( !$ext )
|
||||||
$ext = strrchr($file['name'], '.');
|
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
||||||
|
|
Loading…
Reference in New Issue