Ticket #5481: image.php.diff
| File image.php.diff, 1.1 KB (added by josephscott, 4 years ago) |
|---|
-
image.php
17 17 * If PHP does not have the functionality to save in a file of the same format, the thumbnail will be created as a jpeg. 18 18 */ 19 19 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) { 20 if ( ctype_digit( $file ) ) // Handle int as attachment ID20 if ( is_numeric( $file ) ) // Handle int as attachment ID 21 21 $file = get_attached_file( $file ); 22 22 23 23 $image = wp_load_image( $file ); … … 88 88 * 89 89 */ 90 90 function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { 91 if ( ctype_digit( $src_file ) ) // Handle int as attachment ID91 if ( is_numeric( $src_file ) ) // Handle int as attachment ID 92 92 $src_file = get_attached_file( $src_file ); 93 93 94 94 $src = wp_load_image( $src_file ); … … 172 172 * 173 173 */ 174 174 function wp_load_image( $file ) { 175 if ( ctype_digit( $file ) )175 if ( is_numeric( $file ) ) 176 176 $file = get_attached_file( $file ); 177 177 178 178 if ( ! file_exists( $file ) )
