diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php
index e527b2e..536c89d 100644
a
|
b
|
function wp_tempnam( $filename = '', $dir = '' ) { |
184 | 184 | // Suffix some random data to avoid filename conflicts |
185 | 185 | $temp_filename .= '-' . wp_generate_password( 6, false ); |
186 | 186 | $temp_filename .= '.tmp'; |
187 | | $temp_filename = $dir . wp_unique_filename( $dir, $temp_filename ); |
188 | 187 | |
| 188 | $new_base_name = wp_unique_filename( $dir, $temp_filename ); |
| 189 | if ( strlen( $new_base_name ) > 255 ) { |
| 190 | return wp_tempnam( '', $dir); |
| 191 | } |
| 192 | |
| 193 | $temp_filename = $dir . $new_base_name; |
189 | 194 | $fp = @fopen( $temp_filename, 'x' ); |
190 | 195 | if ( ! $fp && is_writable( $dir ) && file_exists( $temp_filename ) ) { |
191 | 196 | return wp_tempnam( $filename, $dir ); |