Lowercase extensions too, dynamically change when we try to create thumbnails by memory limit.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt 2008-02-11 08:02:01 +00:00
parent 76260edc29
commit f55e3feab2
2 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
$metadata['hwstring_small'] = "height='$uheight' width='$uwidth'";
$metadata['file'] = $file;
$max = apply_filters( 'wp_thumbnail_creation_size_limit', 3 * 1024 * 1024, $attachment_id, $file );
$max = apply_filters( 'wp_thumbnail_creation_size_limit', abs( inval( WP_MEMORY_LIMIT ) ) * 1024 * 1024, $attachment_id, $file );
if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
$max_side = apply_filters( 'wp_thumbnail_max_side_length', 128, $attachment_id, $file );

View File

@ -1070,7 +1070,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL )
// separate the filename into a name and extension
$info = pathinfo($filename);
$ext = $info['extension'];
$ext = strtolower( $info['extension'] );
$name = basename($filename, ".{$ext}");
// Increment the file number until we have a unique file to save in $dir. Use $override['unique_filename_callback'] if supplied.