Changeset 7100 for trunk/wp-includes/post.php
- Timestamp:
- 02/29/2008 06:54:15 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r7074 r7100 885 885 foreach ( (array) $wildcard_mime_types as $type ) { 886 886 $type = str_replace('*', $wild, $type); 887 $patternses[1][$type] = $type;887 $patternses[1][$type] = "^$type$"; 888 888 if ( false === strpos($type, '/') ) { 889 $patternses[2][$type] = "^$type/ $wild$";890 $patternses[3][$type] = "$wild$type$wild";889 $patternses[2][$type] = "^$type/"; 890 $patternses[3][$type] = $type; 891 891 } 892 892 } … … 2362 2362 if ( !is_numeric($mime) ) 2363 2363 $icon = wp_cache_get("mime_type_icon_$mime"); 2364 2365 2364 if ( empty($icon) ) { 2366 2365 $post_id = 0; … … 2371 2370 $post_id = (int) $post->ID; 2372 2371 $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid); 2373 if ( !empty($ext) ) 2372 if ( !empty($ext) ) { 2374 2373 $post_mimes[] = $ext; 2374 if ( $ext_type = wp_ext2type( $ext ) ) 2375 $post_mimes[] = $ext_type; 2376 } 2375 2377 $mime = $post->post_mime_type; 2376 2378 } else { … … 2384 2386 2385 2387 if ( !is_array($icon_files) ) { 2386 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images ' );2387 $icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images ' );2388 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 2389 $icon_dir_uri = apply_filters( 'icon_dir_uri', trailingslashit(get_option('siteurl')) . WPINC . '/images/crystal' ); 2388 2390 $dirs = apply_filters( 'icon_dirs', array($icon_dir => $icon_dir_uri) ); 2389 2391 $icon_files = array(); 2390 foreach ( $dirs as $dir => $uri) { 2392 while ( $dirs ) { 2393 $dir = array_shift(array_keys($dirs)); 2394 $uri = array_shift($dirs); 2391 2395 if ( $dh = opendir($dir) ) { 2392 2396 while ( false !== $file = readdir($dh) ) { 2393 2397 $file = basename($file); 2398 if ( substr($file, 0, 1) == '.' ) 2399 continue; 2394 2400 if ( !in_array(strtolower(substr($file, -4)), array('.png', '.gif', '.jpg') ) ) { 2395 if ( is_dir( $file) )2401 if ( is_dir("$dir/$file") ) 2396 2402 $dirs["$dir/$file"] = "$uri/$file"; 2397 2403 continue;
Note: See TracChangeset
for help on using the changeset viewer.