From 548baad81621eb2c9425478d4699aacb8adfa645 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 25 Apr 2012 20:49:57 +0000 Subject: [PATCH] Remove wp-register.php. * Don't remove it on update. If you have it now, you'll keep it. New installs won't get it. * Peform a redirect using rewrite + canonical to the new location, if the file doesn't exist. props SergeyBiryukov. fixes #18544. git-svn-id: http://svn.automattic.com/wordpress/trunk@20596 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/canonical.php | 9 +++++++++ wp-includes/rewrite.php | 1 + wp-includes/version.php | 2 +- wp-register.php | 14 -------------- 4 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 wp-register.php diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index bffe27ba6..b4d190718 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -277,6 +277,15 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { $redirect['path'] = trailingslashit($redirect['path']) . $addl_path; $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path']; } + + if ( 'wp-register.php' == basename( $redirect['path'] ) ) { + if ( is_multisite() ) + $redirect_url = apply_filters( 'wp_signup_location', site_url( 'wp-signup.php' ) ); + else + $redirect_url = site_url( 'wp-login.php?action=register' ); + wp_redirect( $redirect_url, 301 ); + die(); + } } // tack on any additional query vars diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index b805515fb..13808d14e 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1534,6 +1534,7 @@ class WP_Rewrite { $registration_pages['.*wp-signup.php$'] = $this->index . '?signup=true'; $registration_pages['.*wp-activate.php$'] = $this->index . '?activate=true'; } + $registration_pages['.*wp-register.php$'] = $this->index . '?register=true'; // Deprecated // Post $post_rewrite = $this->generate_rewrite_rules( $this->permalink_structure, EP_PERMALINK, false, true, false, false ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 6150e072e..a58746c19 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -11,7 +11,7 @@ $wp_version = '3.4-beta3-20587'; * * @global int $wp_db_version */ -$wp_db_version = 20148; +$wp_db_version = 20596; /** * Holds the TinyMCE version diff --git a/wp-register.php b/wp-register.php deleted file mode 100644 index a9062e0d5..000000000 --- a/wp-register.php +++ /dev/null @@ -1,14 +0,0 @@ -