Changeset 16154
- Timestamp:
- 11/02/2010 05:19:55 PM (13 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r16151 r16154 2845 2845 2846 2846 /** 2847 * i18n friendly version of basename() 2848 * 2849 * @since 3.1.0 2850 * 2851 * @param string $path A path. 2852 * @param string $suffix If the filename ends in suffix this will also be cut off. 2853 * @return string 2854 */ 2855 function wp_basename( $path, $suffix = '' ) { 2856 return urldecode( basename( str_replace( '%2F', '/', urlencode( $path ) ), $suffix ) ); 2857 } 2858 2859 /** 2847 2860 * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence). 2848 2861 * … … 2851 2864 * @since 3.0.0 2852 2865 */ 2853 2854 2866 function capital_P_dangit( $text ) { 2855 2867 // Simple replacement for titles -
trunk/wp-includes/media.php
r15990 r16154 138 138 $width = $height = 0; 139 139 $is_intermediate = false; 140 $img_url_basename = wp_basename($img_url); 140 141 141 142 // plugins can use this to provide resize services … … 145 146 // try for a new style intermediate size 146 147 if ( $intermediate = image_get_intermediate_size($id, $size) ) { 147 $img_url = str_replace( basename($img_url), $intermediate['file'], $img_url);148 $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url); 148 149 $width = $intermediate['width']; 149 150 $height = $intermediate['height']; … … 153 154 // fall back to the old thumbnail 154 155 if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { 155 $img_url = str_replace( basename($img_url),basename($thumb_file), $img_url);156 $img_url = str_replace($img_url_basename, wp_basename($thumb_file), $img_url); 156 157 $width = $info[0]; 157 158 $height = $info[1]; … … 437 438 $dir = $info['dirname']; 438 439 $ext = $info['extension']; 439 $name = basename($file, ".{$ext}"); 440 $name = wp_basename($file, ".$ext"); 441 440 442 if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) ) 441 443 $dir = $_dest_path; … … 486 488 $resized_file = apply_filters('image_make_intermediate_size', $resized_file); 487 489 return array( 488 'file' => basename( $resized_file ),490 'file' => wp_basename( $resized_file ), 489 491 'width' => $info[0], 490 492 'height' => $info[1], … … 607 609 if ( $icon && $src = wp_mime_type_icon($attachment_id) ) { 608 610 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/crystal' ); 609 $src_file = $icon_dir . '/' . basename($src);611 $src_file = $icon_dir . '/' . wp_basename($src); 610 612 @list($width, $height) = getimagesize($src_file); 611 613 }
Note: See TracChangeset
for help on using the changeset viewer.