From 129dddd3a34fca2061cace23519b605881053962 Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Mon, 11 Feb 2008 08:02:01 +0000 Subject: [PATCH] Lowercase extensions too, dynamically change when we try to create thumbnails by memory limit. git-svn-id: https://develop.svn.wordpress.org/trunk@6783 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/image.php | 2 +- wp-includes/functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index 1781716998..96c301457f 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -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 ); diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 87d7eb138b..05e0720099 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -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.