Ticket #6073: wp_upload_dir_bug-r7133.patch
| File wp_upload_dir_bug-r7133.patch, 1.0 KB (added by tellyworth, 5 years ago) |
|---|
-
wordpress/wp-includes/functions.php
1063 1063 // Returns an array containing the current upload directory's path and url, or an error message. 1064 1064 function wp_upload_dir( $time = NULL ) { 1065 1065 $siteurl = get_option( 'siteurl' ); 1066 $upload_path = $dir = get_option( 'upload_path' ); 1066 $upload_path = get_option( 'upload_path' ); 1067 if ( trim($upload_path) === '' ) 1068 $upload_path = 'wp-content/uploads'; 1069 $dir = $upload_path; 1067 1070 1068 1071 // $dir is absolute, $path is (maybe) relative to ABSPATH 1069 1072 $dir = path_join( ABSPATH, $upload_path ); … … 1072 1075 if ( !$url = get_option( 'upload_url_path' ) ) 1073 1076 $url = trailingslashit( $siteurl ) . $path; 1074 1077 1075 if ( $dir == ABSPATH ) // the option was empty1076 $dir = ABSPATH . 'wp-content/uploads';1077 1078 1078 if ( defined('UPLOADS') ) { 1079 1079 $dir = ABSPATH . UPLOADS; 1080 1080 $url = trailingslashit( $siteurl ) . UPLOADS;
