<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12674] trunk: Add is_subdomain_install() to ms code - Fixes #11796</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12674">12674</a></dd>
<dt>Author</dt> <dd>wpmuguru</dd>
<dt>Date</dt> <dd>2010-01-08 21:25:01 +0000 (Fri, 08 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add is_subdomain_install() to ms code - Fixes <a href="http://trac.wordpress.org/ticket/11796">#11796</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsoptionsphp">trunk/wp-admin/ms-options.php</a></li>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpconfigsamplephp">trunk/wp-config-sample.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwpincludesmssettingsphp">trunk/wp-includes/ms-settings.php</a></li>
<li><a href="#trunkwpsignupphp">trunk/wp-signup.php</a></li>
</ul>

<h3>Property Changed</h3>
<ul>
<li><a href="#trunkwpconfigsamplephp">trunk/wp-config-sample.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-admin/includes/ms.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -732,7 +732,7 @@
</span><span class="cx"> add_action( 'admin_notices', 'site_admin_notice' );
</span><span class="cx"> 
</span><span class="cx"> function avoid_blog_page_permalink_collision( $data, $postarr ) {
</span><del>-        if( constant( 'VHOST' ) == 'yes' )
</del><ins>+        if( is_subdomain_install() )
</ins><span class="cx">                 return $data;
</span><span class="cx">         if( $data[ 'post_type' ] != 'page' )
</span><span class="cx">                 return $data;
</span></span></pre></div>
<a id="trunkwpadminmseditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-edit.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-admin/ms-edit.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">                         if ( false === $blog_details ) {
</span><span class="cx">                                 if ( is_numeric( $dashboard_blog ) )
</span><span class="cx">                                         wp_die( __( 'Dashboard blog_id must be a blog that already exists' ) );
</span><del>-                                if ( constant( 'VHOST' ) == 'yes' ) {
</del><ins>+                                if ( is_subdomain_install() ) {
</ins><span class="cx">                                         $domain = $dashboard_blog . '.' . $current_site-&gt;domain;
</span><span class="cx">                                         $path = $current_site-&gt;path;
</span><span class="cx">                                 } else {
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">                 if( !is_email( $email ) )
</span><span class="cx">                         wp_die( __('Invalid email address') );
</span><span class="cx"> 
</span><del>-                if( constant( 'VHOST' ) == 'yes' ) {
</del><ins>+                if( is_subdomain_install() ) {
</ins><span class="cx">                         $newdomain = $domain.&quot;.&quot;.$current_site-&gt;domain;
</span><span class="cx">                         $path = $base;
</span><span class="cx">                 } else {
</span></span></pre></div>
<a id="trunkwpadminmsoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-options.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-options.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-admin/ms-options.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">                                         &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration3&quot; value='user' &lt;?php echo get_site_option('registration') == 'user' ? 'checked=&quot;checked&quot;' : ''; ?&gt; /&gt; &lt;?php _e('Only user account can be created.'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</span><span class="cx">                                         &lt;label&gt;&lt;input name=&quot;registration&quot; type=&quot;radio&quot; id=&quot;registration4&quot; value='blog' &lt;?php echo get_site_option('registration') == 'blog' ? 'checked=&quot;checked&quot;' : ''; ?&gt; /&gt; &lt;?php _e('Only logged in users can create new blogs.'); ?&gt;&lt;/label&gt;&lt;br /&gt;
</span><span class="cx">                                         &lt;p&gt;&lt;?php _e('Disable or enable registration and who or what can be registered. (Default=all)'); ?&gt;&lt;/p&gt;
</span><del>-                                        &lt;?php if( constant( 'VHOST' ) == 'yes' ) {
</del><ins>+                                        &lt;?php if( is_subdomain_install() ) {
</ins><span class="cx">                                                 echo &quot;&lt;p&gt;&quot; . __('If registration is disabled, please set &quot;NOBLOGREDIRECT&quot; in wp-config.php to a url you will redirect visitors to if they visit a non existant blog.') . &quot;&lt;/p&gt;&quot;;
</span><span class="cx">                                         } ?&gt;
</span><span class="cx">                                 &lt;/td&gt;
</span></span></pre></div>
<a id="trunkwpadminmssitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-sites.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-admin/ms-sites.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -401,7 +401,7 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;?php
</span><span class="cx">                 // define the columns to display, the syntax is 'internal name' =&gt; 'display name'
</span><del>-                $blogname_columns = ( constant( &quot;VHOST&quot; ) == 'yes' ) ? __('Domain') : __('Path');
</del><ins>+                $blogname_columns = ( is_subdomain_install() ) ? __('Domain') : __('Path');
</ins><span class="cx">                 $posts_columns = array(
</span><span class="cx">                         'id'           =&gt; __('ID'),
</span><span class="cx">                         'blogname'     =&gt; $blogname_columns,
</span><span class="lines">@@ -457,7 +457,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                         echo &quot;&lt;tr $bgcolour class='$class'&gt;&quot;;
</span><span class="cx"> 
</span><del>-                                        $blogname = ( constant( &quot;VHOST&quot; ) == 'yes' ) ? str_replace('.'.$current_site-&gt;domain, '', $blog['domain']) : $blog['path'];
</del><ins>+                                        $blogname = ( is_subdomain_install() ) ? str_replace('.'.$current_site-&gt;domain, '', $blog['domain']) : $blog['path'];
</ins><span class="cx">                                         foreach( $posts_columns as $column_name=&gt;$column_display_name ) {
</span><span class="cx">                                                 switch($column_name) {
</span><span class="cx">                                                         case 'id': ?&gt;
</span><span class="lines">@@ -586,7 +586,7 @@
</span><span class="cx">                                         &lt;tr class=&quot;form-field form-required&quot;&gt;
</span><span class="cx">                                                 &lt;th style=&quot;text-align:center;&quot; scope='row'&gt;&lt;?php _e('Blog Address') ?&gt;&lt;/th&gt;
</span><span class="cx">                                                 &lt;td&gt;
</span><del>-                                                &lt;?php if ( constant( &quot;VHOST&quot; ) == 'yes' ) { ?&gt;
</del><ins>+                                                &lt;?php if ( is_subdomain_install() ) { ?&gt;
</ins><span class="cx">                                                         &lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; title=&quot;&lt;?php _e('Domain') ?&gt;&quot;/&gt;.&lt;?php echo $current_site-&gt;domain;?&gt;
</span><span class="cx">                                                 &lt;?php } else {
</span><span class="cx">                                                         echo $current_site-&gt;domain . $current_site-&gt;path ?&gt;&lt;input name=&quot;blog[domain]&quot; type=&quot;text&quot; title=&quot;&lt;?php _e('Domain') ?&gt;&quot;/&gt;
</span></span></pre></div>
<a id="trunkwpconfigsamplephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-config-sample.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-config-sample.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-config-sample.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -1,76 +1,76 @@
</span><del>-&lt;?php
-/** 
- * The base configurations of the WordPress.
- *
- * This file has the following configurations: MySQL settings, Table Prefix,
- * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
- * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
- * wp-config.php} Codex page. You can get the MySQL settings from your web host.
- *
- * This file is used by the wp-config.php creation script during the
- * installation. You don't have to use the web site, you can just copy this file
- * to &quot;wp-config.php&quot; and fill in the values.
- *
- * @package WordPress
- */
-
-// ** MySQL settings - You can get this info from your web host ** //
-/** The name of the database for WordPress */
-define('DB_NAME', 'putyourdbnamehere');
-
-/** MySQL database username */
-define('DB_USER', 'usernamehere');
-
-/** MySQL database password */
-define('DB_PASSWORD', 'yourpasswordhere');
-
-/** MySQL hostname */
-define('DB_HOST', 'localhost');
-
-/** Database Charset to use in creating database tables. */
-define('DB_CHARSET', 'utf8');
-
-/** The Database Collate type. Don't change this if in doubt. */
-define('DB_COLLATE', '');
-
-/**#@+
- * Authentication Unique Keys.
- *
- * Change these to different unique phrases!
- * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
- * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
- *
- * @since 2.6.0
- */
-define('AUTH_KEY', 'put your unique phrase here');
-define('SECURE_AUTH_KEY', 'put your unique phrase here');
-define('LOGGED_IN_KEY', 'put your unique phrase here');
-define('NONCE_KEY', 'put your unique phrase here');
-/**#@-*/
-
-/**
- * WordPress Database Table prefix.
- *
- * You can have multiple installations in one database if you give each a unique
- * prefix. Only numbers, letters, and underscores please!
- */
-$table_prefix  = 'wp_';
-
-/**
- * WordPress Localized Language, defaults to English.
- *
- * Change this to localize WordPress.  A corresponding MO file for the chosen
- * language must be installed to wp-content/languages. For example, install
- * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
- * language support.
- */
-define ('WPLANG', '');
-
-/* That's all, stop editing! Happy blogging. */
-
-/** Absolute path to the WordPress directory. */
-if ( !defined('ABSPATH') )
-        define('ABSPATH', dirname(__FILE__) . '/');
-
-/** Sets up WordPress vars and included files. */
-require_once(ABSPATH . 'wp-settings.php');
</del><ins>+&lt;?php
+/** 
+ * The base configurations of the WordPress.
+ *
+ * This file has the following configurations: MySQL settings, Table Prefix,
+ * Secret Keys, WordPress Language, and ABSPATH. You can find more information by
+ * visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
+ * wp-config.php} Codex page. You can get the MySQL settings from your web host.
+ *
+ * This file is used by the wp-config.php creation script during the
+ * installation. You don't have to use the web site, you can just copy this file
+ * to &quot;wp-config.php&quot; and fill in the values.
+ *
+ * @package WordPress
+ */
+
+// ** MySQL settings - You can get this info from your web host ** //
+/** The name of the database for WordPress */
+define('DB_NAME', 'putyourdbnamehere');
+
+/** MySQL database username */
+define('DB_USER', 'usernamehere');
+
+/** MySQL database password */
+define('DB_PASSWORD', 'yourpasswordhere');
+
+/** MySQL hostname */
+define('DB_HOST', 'localhost');
+
+/** Database Charset to use in creating database tables. */
+define('DB_CHARSET', 'utf8');
+
+/** The Database Collate type. Don't change this if in doubt. */
+define('DB_COLLATE', '');
+
+/**#@+
+ * Authentication Unique Keys.
+ *
+ * Change these to different unique phrases!
+ * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service}
+ * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
+ *
+ * @since 2.6.0
+ */
+define('AUTH_KEY', 'put your unique phrase here');
+define('SECURE_AUTH_KEY', 'put your unique phrase here');
+define('LOGGED_IN_KEY', 'put your unique phrase here');
+define('NONCE_KEY', 'put your unique phrase here');
+/**#@-*/
+
+/**
+ * WordPress Database Table prefix.
+ *
+ * You can have multiple installations in one database if you give each a unique
+ * prefix. Only numbers, letters, and underscores please!
+ */
+$table_prefix  = 'wp_';
+
+/**
+ * WordPress Localized Language, defaults to English.
+ *
+ * Change this to localize WordPress.  A corresponding MO file for the chosen
+ * language must be installed to wp-content/languages. For example, install
+ * de.mo to wp-content/languages and set WPLANG to 'de' to enable German
+ * language support.
+ */
+define ('WPLANG', '');
+
+/* That's all, stop editing! Happy blogging. */
+
+/** Absolute path to the WordPress directory. */
+if ( !defined('ABSPATH') )
+        define('ABSPATH', dirname(__FILE__) . '/');
+
+/** Sets up WordPress vars and included files. */
+require_once(ABSPATH . 'wp-settings.php');
</ins><span class="cx">Property changes on: trunk/wp-config-sample.php
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:eol-style
</span><span class="cx">   - CRLF
</span><span class="cx">   + native
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-includes/ms-functions.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> function get_blogaddress_by_name( $blogname ) {
</span><span class="cx">         global $current_site;
</span><span class="cx"> 
</span><del>-        if( defined( &quot;VHOST&quot; ) &amp;&amp; constant( &quot;VHOST&quot; ) == 'yes' ) {
</del><ins>+        if( is_subdomain_install() ) {
</ins><span class="cx">                 if( $blogname == 'main' )
</span><span class="cx">                         $blogname = 'www';
</span><span class="cx">                 return clean_url( &quot;http://&quot; . $blogname . &quot;.&quot; . $current_site-&gt;domain . $current_site-&gt;path );
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function get_blogaddress_by_domain( $domain, $path ){
</span><del>-        if( defined( &quot;VHOST&quot; ) &amp;&amp; constant( &quot;VHOST&quot; ) == 'yes' ) {
</del><ins>+        if( is_subdomain_install() ) {
</ins><span class="cx">                 $url = &quot;http://&quot;.$domain.$path;
</span><span class="cx">         } else {
</span><span class="cx">                 if( $domain != $_SERVER['HTTP_HOST'] ) {
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">         if ( $blog_id )
</span><span class="cx">                 return $blog_id;
</span><span class="cx"> 
</span><del>-        if ( defined('VHOST') &amp;&amp; constant( 'VHOST' ) == 'yes' ) {
</del><ins>+        if ( is_subdomain_install() ) {
</ins><span class="cx">                 $domain = $name . '.' . $current_site-&gt;domain;
</span><span class="cx">                 $path = $current_site-&gt;path;
</span><span class="cx">         } else {
</span><span class="lines">@@ -1033,7 +1033,7 @@
</span><span class="cx">                 $errors-&gt;add('blogname', __(&quot;Sorry, blog names may not contain the character '_'!&quot;));
</span><span class="cx"> 
</span><span class="cx">         // do not allow users to create a blog that conflicts with a page on the main blog.
</span><del>-        if ( constant( &quot;VHOST&quot; ) == 'no' &amp;&amp; $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT post_name FROM &quot; . $wpdb-&gt;get_blog_prefix( $current_site-&gt;blog_id ) . &quot;posts WHERE post_type = 'page' AND post_name = %s&quot;, $blogname ) ) ) {
</del><ins>+        if ( !is_subdomain_install() &amp;&amp; $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT post_name FROM &quot; . $wpdb-&gt;get_blog_prefix( $current_site-&gt;blog_id ) . &quot;posts WHERE post_type = 'page' AND post_name = %s&quot;, $blogname ) ) ) {
</ins><span class="cx">                 $errors-&gt;add( 'blogname', __( &quot;Sorry, you may not use that blog name&quot; ) );
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -1051,7 +1051,7 @@
</span><span class="cx">             $errors-&gt;add('blog_title', __(&quot;Please enter a blog title&quot;));
</span><span class="cx"> 
</span><span class="cx">         // Check if the domain/path has been used already.
</span><del>-        if( constant( &quot;VHOST&quot; ) == 'yes' ) {
</del><ins>+        if( is_subdomain_install() ) {
</ins><span class="cx">                 $mydomain = &quot;$blogname.$domain&quot;;
</span><span class="cx">                 $path = $base;
</span><span class="cx">         } else {
</span><span class="lines">@@ -1138,7 +1138,7 @@
</span><span class="cx">                 return false;
</span><span class="cx"> 
</span><span class="cx">         // Send email with activation link.
</span><del>-        if( constant( &quot;VHOST&quot; ) == 'no' || $current_site-&gt;id != 1 ) {
</del><ins>+        if( !is_subdomain_install() || $current_site-&gt;id != 1 ) {
</ins><span class="cx">                 $activate_url = &quot;http://&quot; . $current_site-&gt;domain . $current_site-&gt;path . &quot;wp-activate.php?key=$key&quot;;
</span><span class="cx">         } else {
</span><span class="cx">                 $activate_url = &quot;http://{$domain}{$path}wp-activate.php?key=$key&quot;;
</span><span class="lines">@@ -1267,7 +1267,7 @@
</span><span class="cx"> 
</span><span class="cx"> function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1) {
</span><span class="cx">         $domain = preg_replace( &quot;/\s+/&quot;, '', sanitize_user( $domain, true ) );
</span><del>-        if( constant( 'VHOST' ) == 'yes' )
</del><ins>+        if( is_subdomain_install() )
</ins><span class="cx">                 $domain = str_replace( '@', '', $domain );
</span><span class="cx">         $title = strip_tags( $title );
</span><span class="cx">         $user_id = (int) $user_id;
</span></span></pre></div>
<a id="trunkwpincludesmssettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-settings.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-settings.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-includes/ms-settings.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -1,4 +1,19 @@
</span><span class="cx"> &lt;?php
</span><ins>+
+/**
+ * Whether a subdomain configuration is enabled
+ *
+ * @since 3.0
+ *
+ * @return bool True if subdomain configuration is enabled, false otherwise.
+ */
+function is_subdomain_install() {
+        if ( defined('VHOST') &amp;&amp; VHOST == 'yes' )
+                return true;
+
+        return false;
+}
+
</ins><span class="cx"> if( isset( $current_site ) &amp;&amp; isset( $current_blog ) )
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -65,7 +80,7 @@
</span><span class="cx">                 return $current_site;
</span><span class="cx">         }
</span><span class="cx">         $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
</span><del>-        if( constant( 'VHOST' ) == 'yes' ) {
</del><ins>+        if( is_subdomain_install() ) {
</ins><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path = %s&quot;, $domain, $path) );
</span><span class="cx">                 if( $current_site != null )
</span><span class="cx">                         return $current_site;
</span><span class="lines">@@ -113,7 +128,7 @@
</span><span class="cx"> if( !isset( $current_site-&gt;blog_id ) )
</span><span class="cx">         $current_site-&gt;blog_id = $wpdb-&gt;get_var( &quot;SELECT blog_id FROM {$wpdb-&gt;blogs} WHERE domain='{$current_site-&gt;domain}' AND path='{$current_site-&gt;path}'&quot; );
</span><span class="cx"> 
</span><del>-if( constant( 'VHOST' ) == 'yes' ) {
</del><ins>+if( is_subdomain_install() ) {
</ins><span class="cx">         $current_blog = wp_cache_get( 'current_blog_' . $domain, 'site-options' );
</span><span class="cx">         if( !$current_blog ) {
</span><span class="cx">                 $current_blog = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;blogs WHERE domain = %s&quot;, $domain) );
</span><span class="lines">@@ -143,7 +158,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if( defined( &quot;WP_INSTALLING&quot; ) == false &amp;&amp; constant( 'VHOST' ) == 'yes' &amp;&amp; !is_object( $current_blog ) ) {
</del><ins>+if( defined( &quot;WP_INSTALLING&quot; ) == false &amp;&amp; is_subdomain_install() &amp;&amp; !is_object( $current_blog ) ) {
</ins><span class="cx">         if( defined( 'NOBLOGREDIRECT' ) ) {
</span><span class="cx">                 $destination = constant( 'NOBLOGREDIRECT' );
</span><span class="cx">                 if ( $destination == '%siteurl%' )
</span></span></pre></div>
<a id="trunkwpsignupphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-signup.php (12673 => 12674)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-signup.php        2010-01-08 20:49:55 UTC (rev 12673)
+++ trunk/wp-signup.php        2010-01-08 21:25:01 UTC (rev 12674)
</span><span class="lines">@@ -56,7 +56,7 @@
</span><span class="cx"> function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
</span><span class="cx">         global $current_site;
</span><span class="cx">         // Blog name
</span><del>-        if( constant( &quot;VHOST&quot; ) == 'no' )
</del><ins>+        if( !is_subdomain_install() )
</ins><span class="cx">                 echo '&lt;label for=&quot;blogname&quot;&gt;' . __('Blog Name:') . '&lt;/label&gt;';
</span><span class="cx">         else
</span><span class="cx">                 echo '&lt;label for=&quot;blogname&quot;&gt;' . __('Blog Domain:') . '&lt;/label&gt;';
</span><span class="lines">@@ -65,14 +65,14 @@
</span><span class="cx">                 &lt;p class=&quot;error&quot;&gt;&lt;?php echo $errmsg ?&gt;&lt;/p&gt;
</span><span class="cx">         &lt;?php }
</span><span class="cx"> 
</span><del>-        if( constant( &quot;VHOST&quot; ) == 'no' ) {
</del><ins>+        if( !is_subdomain_install() ) {
</ins><span class="cx">                 echo '&lt;span class=&quot;prefix_address&quot;&gt;' . $current_site-&gt;domain . $current_site-&gt;path . '&lt;/span&gt;&lt;input name=&quot;blogname&quot; type=&quot;text&quot; id=&quot;blogname&quot; value=&quot;'. esc_attr($blogname) .'&quot; maxlength=&quot;50&quot; /&gt;&lt;br /&gt;';
</span><span class="cx">         } else {
</span><span class="cx">                 echo '&lt;input name=&quot;blogname&quot; type=&quot;text&quot; id=&quot;blogname&quot; value=&quot;'.esc_attr($blogname).'&quot; maxlength=&quot;50&quot; /&gt;&lt;span class=&quot;suffix_address&quot;&gt;.' . $current_site-&gt;domain . $current_site-&gt;path . '&lt;/span&gt;&lt;br /&gt;';
</span><span class="cx">         }
</span><span class="cx">         if ( !is_user_logged_in() ) {
</span><span class="cx">                 print '(&lt;strong&gt;' . __( 'Your address will be ' );
</span><del>-                if( constant( &quot;VHOST&quot; ) == 'no' ) {
</del><ins>+                if( !is_subdomain_install() ) {
</ins><span class="cx">                         print $current_site-&gt;domain . $current_site-&gt;path . __( 'blogname' );
</span><span class="cx">                 } else {
</span><span class="cx">                         print __( 'domain.' ) . $current_site-&gt;domain . $current_site-&gt;path;
</span><span class="lines">@@ -420,7 +420,7 @@
</span><span class="cx">                                 _e( &quot;You're logged in already. No need to register again!&quot; );
</span><span class="cx">                         }
</span><span class="cx">                         if ($newblogname) {
</span><del>-                                if( constant( &quot;VHOST&quot; ) == 'no' )
</del><ins>+                                if( !is_subdomain_install() )
</ins><span class="cx">                                         $newblog = 'http://' . $current_site-&gt;domain . $current_site-&gt;path . $newblogname . '/';
</span><span class="cx">                                 else
</span><span class="cx">                                         $newblog = 'http://' . $newblogname . '.' . $current_site-&gt;domain . $current_site-&gt;path;
</span></span></pre>
</div>
</div>

</body>
</html>