Use Absolute URL's & API's in header redirects in more locations. See #14062

git-svn-id: http://svn.automattic.com/wordpress/trunk@16008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-10-27 10:43:43 +00:00
parent 432f2a4456
commit 4f3b9f7b7f
14 changed files with 24 additions and 24 deletions

View File

@ -126,7 +126,7 @@ if ( isset($plugin_page) ) {
$query_string = $_SERVER[ 'QUERY_STRING' ];
else
$query_string = 'page=' . $plugin_page;
wp_redirect( 'tools.php?' . $query_string );
wp_redirect( admin_url('tools.php?' . $query_string) );
exit;
}
}

View File

@ -37,7 +37,7 @@ if ( current_user_can('install_plugins') )
);
if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) {
wp_redirect("import.php?import=" . $popular_importers[$_GET['invalid']][3]);
wp_redirect( admin_url('import.php?import=' . $popular_importers[$_GET['invalid']][3]) );
exit;
}

View File

@ -24,7 +24,7 @@ if ( !empty($_POST['move']) )
if ( !empty($_POST['linkcheck']) )
$linkcheck = $_POST['linkcheck'];
$this_file = 'link-manager.php';
$this_file = admin_url('link-manager.php');
switch ($action) {
case 'deletebookmarks' :

View File

@ -48,7 +48,7 @@ case 'edit' :
$errors = null;
if ( empty( $_GET['attachment_id'] ) ) {
wp_redirect('upload.php');
wp_redirect( admin_url('upload.php') );
exit();
}
$att_id = (int) $_GET['attachment_id'];
@ -118,7 +118,7 @@ case 'edit' :
exit;
default:
wp_redirect( 'upload.php' );
wp_redirect( admin_url('upload.php') );
exit;
endswitch;

View File

@ -8,5 +8,5 @@
* @subpackage Administration
*/
require_once('../wp-load.php');
wp_redirect('edit-comments.php?comment_status=moderated');
wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
?>

View File

@ -67,9 +67,9 @@ case 'update':
wp_redirect(add_query_arg('_wpnonce', wp_create_nonce('edit-plugin-test_' . $file), "plugin-editor.php?file=$file&liveupdate=1&scrollto=$scrollto&networkwide=" . $network_wide));
exit;
}
wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
wp_redirect( adin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
} else {
wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto");
wp_redirect( admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") );
}
exit;
@ -87,7 +87,7 @@ default:
if ( ! is_plugin_active($file) )
activate_plugin($file, "plugin-editor.php?file=$file&phperror=1", ! empty( $_GET['networkwide'] ) ); // we'll override this later if the plugin can be included without fatal error
wp_redirect("plugin-editor.php?file=$file&a=te&scrollto=$scrollto");
wp_redirect( admin_url("plugin-editor.php?file=$file&a=te&scrollto=$scrollto") );
exit;
}

View File

@ -138,7 +138,7 @@ case 'edit':
$editing = true;
if ( empty( $post_id ) ) {
wp_redirect("post.php");
wp_redirect( admin_url('post.php') );
exit();
}
@ -265,7 +265,7 @@ case 'preview':
break;
default:
wp_redirect('edit.php');
wp_redirect( admin_url('edit.php') );
exit();
break;
} // end switch

View File

@ -16,14 +16,14 @@ if ( current_user_can('switch_themes') && isset($_GET['action']) ) {
if ( 'activate' == $_GET['action'] ) {
check_admin_referer('switch-theme_' . $_GET['template']);
switch_theme($_GET['template'], $_GET['stylesheet']);
wp_redirect('themes.php?activated=true');
wp_redirect( admin_url('themes.php?activated=true') );
exit;
} else if ( 'delete' == $_GET['action'] ) {
check_admin_referer('delete-theme_' . $_GET['template']);
if ( !current_user_can('delete_themes') )
wp_die( __( 'Cheatin’ uh?' ) );
delete_theme($_GET['template']);
wp_redirect('themes.php?deleted=true');
wp_redirect( admin_url('themes.php?deleted=true') );
exit;
}
}

View File

@ -431,7 +431,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( isset( $_POST['checked'] ) ) {
$plugins = (array) $_POST['checked'];
} else {
wp_redirect('update-core.php');
wp_redirect( admin_url('update-core.php') );
exit;
}
@ -454,7 +454,7 @@ if ( 'upgrade-core' == $action ) {
} elseif ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
} else {
wp_redirect('update-core.php');
wp_redirect( admin_url('update-core.php') );
exit;
}

View File

@ -70,9 +70,9 @@ if ( isset($_GET['action']) ) {
check_admin_referer('activate-plugin_' . $plugin);
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
wp_redirect( 'update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] );
wp_redirect( admin_url('update.php?action=activate-plugin&failure=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
activate_plugin( $plugin, '', ! empty( $_GET['networkwide'] ) );
wp_redirect( 'update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce'] );
wp_redirect( admin_url('update.php?action=activate-plugin&success=true&plugin=' . $plugin . '&_wpnonce=' . $_GET['_wpnonce']) );
die();
}
iframe_header( __('Plugin Reactivation'), true );

View File

@ -175,7 +175,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) {
if ( !in_array($widget_id, $sidebar, true) ) {
wp_redirect('widgets.php?error=0');
wp_redirect( admin_url('widgets.php?error=0') );
exit;
}
@ -208,7 +208,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
}
wp_set_sidebars_widgets($sidebars_widgets);
wp_redirect('widgets.php?message=0');
wp_redirect( admin_url('widgets.php?message=0') );
exit;
}

View File

@ -430,7 +430,7 @@ case 'rp' :
$user = check_password_reset_key($_GET['key'], $_GET['login']);
if ( is_wp_error($user) ) {
wp_redirect('wp-login.php?action=lostpassword&error=invalidkey');
wp_redirect( site_url('wp-login.php?action=lostpassword&error=invalidkey') );
exit;
}
@ -484,12 +484,12 @@ break;
case 'register' :
if ( is_multisite() ) {
// Multisite uses wp-signup.php
wp_redirect( apply_filters( 'wp_signup_location', get_bloginfo('wpurl') . '/wp-signup.php' ) );
wp_redirect( apply_filters( 'wp_signup_location', site_url('wp-signup.php') ) );
exit;
}
if ( !get_option('users_can_register') ) {
wp_redirect('wp-login.php?registration=disabled');
wp_redirect( site_url('wp-login.php?registration=disabled') );
exit();
}

View File

@ -10,6 +10,6 @@
*/
require('./wp-load.php');
wp_redirect('wp-login.php?action=register');
wp_redirect( site_url('wp-login.php?action=register') );
?>

View File

@ -23,7 +23,7 @@ function signuppageheaders() {
}
if ( !is_multisite() ) {
wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
wp_redirect( site_url('wp-login.php?action=register') );
die();
}