Ticket #12735: fix-get_blogadd-net_site-site_path.patch
File fix-get_blogadd-net_site-site_path.patch, 4.9 KB (added by , 14 years ago) |
---|
-
wp-includes/link-template.php
1900 1900 if ( empty($blog_id) || !is_multisite() ) 1901 1901 $url = get_option('siteurl'); 1902 1902 else 1903 $url = untrailingslashit(get_blog address_by_id($blog_id));1903 $url = untrailingslashit(get_blog_option($blog_id,'siteurl')); 1904 1904 1905 1905 $url = str_replace( 'http://', "{$scheme}://", $url ); 1906 1906 … … 2053 2053 $scheme = ( is_ssl() ? 'https' : 'http' ); 2054 2054 } 2055 2055 2056 $url = 'http://' . $current_site->domain . $current_site-> path;2056 $url = 'http://' . $current_site->domain . $current_site->site_path; 2057 2057 2058 2058 $url = str_replace( 'http://', "{$scheme}://", $url ); 2059 2059 -
wp-includes/ms-blogs.php
19 19 } 20 20 21 21 function get_blogaddress_by_id( $blog_id ) { 22 $bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details! 23 return esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ); 22 return get_blog_option($blog_id,'home'); 24 23 } 25 24 26 25 function get_blogaddress_by_name( $blogname ) { 27 26 global $current_site; 28 27 29 28 if ( is_subdomain_install() ) { 29 if(strpos($current_site->domain,$blogname)!==false) 30 return esc_url('http://'.$current_site->domain . $current_site->path); 30 31 if ( $blogname == 'main' ) 31 32 $blogname = 'www'; 32 33 return esc_url( 'http://' . $blogname . '.' . $current_site->domain . $current_site->path ); 33 34 } else { 35 if(strpos($current_site->path,$blogname)!==false) 36 return esc_url( 'http://' . $current_site->domain . $current_site->path); 34 37 return esc_url( 'http://' . $current_site->domain . $current_site->path . $blogname . '/' ); 35 38 } 36 39 } -
wp-includes/ms-default-constants.php
46 46 * @since 1.5.0 47 47 */ 48 48 if ( !defined( 'SITECOOKIEPATH' ) ) 49 define( 'SITECOOKIEPATH', $current_site-> path );49 define( 'SITECOOKIEPATH', $current_site->site_path ); 50 50 51 51 /** 52 52 * @since 2.6.0 -
wp-includes/ms-load.php
96 96 * @return object $current_site object 97 97 */ 98 98 function wpmu_current_site() { 99 global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain ;99 global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain,$site_path; 100 100 if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) { 101 $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; 101 $site_path = defined('PATH_WP_INSTALL') ? PATH_WP_INSTALL:PATH_CURRENT_SITE; 102 $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; 102 103 $current_site->domain = DOMAIN_CURRENT_SITE; 103 104 $current_site->path = $path = PATH_CURRENT_SITE; 105 $current_site->site_path=$site_path; 104 106 if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) 105 107 $current_site->blog_id = BLOG_ID_CURRENT_SITE; 106 108 elseif ( defined( 'BLOGID_CURRENT_SITE' ) ) // deprecated. … … 126 128 $current_site = $sites[0]; 127 129 wp_load_core_site_options( $current_site->id ); 128 130 $path = $current_site->path; 131 $site_path = defined('PATH_WP_INSTALL') ? PATH_WP_INSTALL:$path; 129 132 $current_site->blog_id = $wpdb->get_var( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE domain = %s AND path = %s", $current_site->domain, $current_site->path ) ); 130 133 $current_site = get_current_site_name( $current_site ); 131 134 if ( substr( $current_site->domain, 0, 4 ) == 'www.' ) 132 135 $current_site->cookie_domain = substr( $current_site->domain, 4 ); 136 $current_site->site_path=$site_path; 133 137 wp_cache_set( 'current_site', $current_site, 'site-options' ); 134 138 return $current_site; 135 139 } … … 149 153 150 154 if ( $current_site ) { 151 155 $path = $current_site->path; 156 $site_path = defined('PATH_WP_INSTALL') ? PATH_WP_INSTALL:$path; 152 157 $current_site->cookie_domain = $cookie_domain; 158 $current_site->site_path=$site_path; 153 159 return $current_site; 154 160 } 155 161 … … 158 164 $current_site = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $sitedomain, $path) ); 159 165 if ( $current_site ) { 160 166 $current_site->cookie_domain = $current_site->domain; 167 $site_path = defined('PATH_WP_INSTALL') ? PATH_WP_INSTALL:$current_site->path; 168 $current_site->site_path=$site_path; 161 169 return $current_site; 162 170 } 163 171 … … 166 174 167 175 if ( $current_site || defined( 'WP_INSTALLING' ) ) { 168 176 $path = '/'; 177 $site_path = defined('PATH_WP_INSTALL') ? PATH_WP_INSTALL:$path; 178 $current_site->site_path=$site_path; 169 179 return $current_site; 170 180 } 171 181