summaryrefslogtreecommitdiffstats
path: root/wpmu-settings.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-27 14:11:27 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-27 14:11:27 +0000
commitbc96ad1ac715d2db115b24880fef67aae6b3903b (patch)
treefee5fa352bb1109127663aebb728727f09c7ee5e /wpmu-settings.php
parentd7a0e0bed98dccdcd11a1b21cdff9423c3cc59c7 (diff)
downloadwordpress-mu-bc96ad1ac715d2db115b24880fef67aae6b3903b.tar.gz
wordpress-mu-bc96ad1ac715d2db115b24880fef67aae6b3903b.tar.xz
wordpress-mu-bc96ad1ac715d2db115b24880fef67aae6b3903b.zip
Redirect to signup form if blog not found (#28)
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@603 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wpmu-settings.php')
-rw-r--r--wpmu-settings.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/wpmu-settings.php b/wpmu-settings.php
index e80999b..9cb37d6 100644
--- a/wpmu-settings.php
+++ b/wpmu-settings.php
@@ -53,12 +53,17 @@ if( isset( $current_site ) == false ) {
if( constant( 'VHOST' ) == 'yes' ) {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain'");
- if( $current_blog != null )
+ if( $current_blog != null ) {
$current_site = $wpdb->get_row("SELECT * FROM $wpdb->site WHERE id='{$current_blog->site_id}'");
+ } else {
+ $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
+ }
} else {
$blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );
if( strpos( $blogname, '/' ) )
$blogname = substr( $blogname, 0, strpos( $blogname, '/' ) );
+ if( strpos( $blogname, '?' ) )
+ $blogname = substr( $blogname, 0, strpos( $blogname, '?' ) );
if( $blogname == '' || $blogname == 'blog' || $blogname == 'wp-admin' || $blogname == 'files' || $blogname == 'feed' || is_file( $blogname ) ) {
$current_blog = $wpdb->get_row("SELECT * FROM $wpdb->blogs WHERE domain = '$domain' AND path = '$path'");
} else {
@@ -67,6 +72,10 @@ if( constant( 'VHOST' ) == 'yes' ) {
}
if( defined( "WP_INSTALLING" ) == false ) {
+ if( $current_site && $current_blog == null ) {
+ header( "Location: http://{$current_site->domain}{$current_site->path}wp-signup.php?new=" . urlencode( $blogname ) );
+ die();
+ }
if( $current_blog == false || $current_site == false )
is_installed();
}