Changeset 36569 for trunk/src/wp-includes/post.php
- Timestamp:
- 02/18/2016 12:23:04 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r36566 r36569 187 187 function get_attached_file( $attachment_id, $unfiltered = false ) { 188 188 $file = get_post_meta( $attachment_id, '_wp_attached_file', true ); 189 189 190 // If the file is relative, prepend upload dir. 190 if ( $file && 0 !== strpos( $file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )191 if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) && ( ( $uploads = wp_get_upload_dir() ) && false === $uploads['error'] ) ) { 191 192 $file = $uploads['basedir'] . "/$file"; 192 if ( $unfiltered ) 193 } 194 195 if ( $unfiltered ) { 193 196 return $file; 197 } 194 198 195 199 /** … … 249 253 $new_path = $path; 250 254 251 $uploads = wp_ upload_dir();255 $uploads = wp_get_upload_dir(); 252 256 if ( 0 === strpos( $new_path, $uploads['basedir'] ) ) { 253 257 $new_path = str_replace( $uploads['basedir'], '', $new_path ); … … 4848 4852 do_action( 'deleted_post', $post_id ); 4849 4853 4850 $uploadpath = wp_ upload_dir();4854 $uploadpath = wp_get_upload_dir(); 4851 4855 4852 4856 if ( ! empty($meta['thumb']) ) { … … 4965 4969 $url = ''; 4966 4970 // Get attached file. 4967 if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true ) ) {4971 if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true ) ) { 4968 4972 // Get upload directory. 4969 if ( ( $uploads = wp_upload_dir()) && false === $uploads['error'] ) {4973 if ( ( $uploads = wp_get_upload_dir() ) && false === $uploads['error'] ) { 4970 4974 // Check that the upload base exists in the file location. 4971 4975 if ( 0 === strpos( $file, $uploads['basedir'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.