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: https://develop.svn.wordpress.org/trunk@20596 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2012-04-25 20:49:57 +00:00
parent 577286e19d
commit b75eefda56
4 changed files with 11 additions and 15 deletions
+9
View File
@@ -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