mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
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:
parent
432f2a4456
commit
4f3b9f7b7f
@ -126,7 +126,7 @@ if ( isset($plugin_page) ) {
|
|||||||
$query_string = $_SERVER[ 'QUERY_STRING' ];
|
$query_string = $_SERVER[ 'QUERY_STRING' ];
|
||||||
else
|
else
|
||||||
$query_string = 'page=' . $plugin_page;
|
$query_string = 'page=' . $plugin_page;
|
||||||
wp_redirect( 'tools.php?' . $query_string );
|
wp_redirect( admin_url('tools.php?' . $query_string) );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ if ( current_user_can('install_plugins') )
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( ! empty( $_GET['invalid'] ) && !empty($popular_importers[$_GET['invalid']][3]) ) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ if ( !empty($_POST['move']) )
|
|||||||
if ( !empty($_POST['linkcheck']) )
|
if ( !empty($_POST['linkcheck']) )
|
||||||
$linkcheck = $_POST['linkcheck'];
|
$linkcheck = $_POST['linkcheck'];
|
||||||
|
|
||||||
$this_file = 'link-manager.php';
|
$this_file = admin_url('link-manager.php');
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'deletebookmarks' :
|
case 'deletebookmarks' :
|
||||||
|
@ -48,7 +48,7 @@ case 'edit' :
|
|||||||
$errors = null;
|
$errors = null;
|
||||||
|
|
||||||
if ( empty( $_GET['attachment_id'] ) ) {
|
if ( empty( $_GET['attachment_id'] ) ) {
|
||||||
wp_redirect('upload.php');
|
wp_redirect( admin_url('upload.php') );
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
$att_id = (int) $_GET['attachment_id'];
|
$att_id = (int) $_GET['attachment_id'];
|
||||||
@ -118,7 +118,7 @@ case 'edit' :
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wp_redirect( 'upload.php' );
|
wp_redirect( admin_url('upload.php') );
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
endswitch;
|
endswitch;
|
||||||
|
@ -8,5 +8,5 @@
|
|||||||
* @subpackage Administration
|
* @subpackage Administration
|
||||||
*/
|
*/
|
||||||
require_once('../wp-load.php');
|
require_once('../wp-load.php');
|
||||||
wp_redirect('edit-comments.php?comment_status=moderated');
|
wp_redirect( admin_url('edit-comments.php?comment_status=moderated') );
|
||||||
?>
|
?>
|
||||||
|
@ -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));
|
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;
|
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 {
|
} else {
|
||||||
wp_redirect("plugin-editor.php?file=$file&scrollto=$scrollto");
|
wp_redirect( admin_url("plugin-editor.php?file=$file&scrollto=$scrollto") );
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ default:
|
|||||||
if ( ! is_plugin_active($file) )
|
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
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ case 'edit':
|
|||||||
$editing = true;
|
$editing = true;
|
||||||
|
|
||||||
if ( empty( $post_id ) ) {
|
if ( empty( $post_id ) ) {
|
||||||
wp_redirect("post.php");
|
wp_redirect( admin_url('post.php') );
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ case 'preview':
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wp_redirect('edit.php');
|
wp_redirect( admin_url('edit.php') );
|
||||||
exit();
|
exit();
|
||||||
break;
|
break;
|
||||||
} // end switch
|
} // end switch
|
||||||
|
@ -16,14 +16,14 @@ if ( current_user_can('switch_themes') && isset($_GET['action']) ) {
|
|||||||
if ( 'activate' == $_GET['action'] ) {
|
if ( 'activate' == $_GET['action'] ) {
|
||||||
check_admin_referer('switch-theme_' . $_GET['template']);
|
check_admin_referer('switch-theme_' . $_GET['template']);
|
||||||
switch_theme($_GET['template'], $_GET['stylesheet']);
|
switch_theme($_GET['template'], $_GET['stylesheet']);
|
||||||
wp_redirect('themes.php?activated=true');
|
wp_redirect( admin_url('themes.php?activated=true') );
|
||||||
exit;
|
exit;
|
||||||
} else if ( 'delete' == $_GET['action'] ) {
|
} else if ( 'delete' == $_GET['action'] ) {
|
||||||
check_admin_referer('delete-theme_' . $_GET['template']);
|
check_admin_referer('delete-theme_' . $_GET['template']);
|
||||||
if ( !current_user_can('delete_themes') )
|
if ( !current_user_can('delete_themes') )
|
||||||
wp_die( __( 'Cheatin’ uh?' ) );
|
wp_die( __( 'Cheatin’ uh?' ) );
|
||||||
delete_theme($_GET['template']);
|
delete_theme($_GET['template']);
|
||||||
wp_redirect('themes.php?deleted=true');
|
wp_redirect( admin_url('themes.php?deleted=true') );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -431,7 +431,7 @@ if ( 'upgrade-core' == $action ) {
|
|||||||
} elseif ( isset( $_POST['checked'] ) ) {
|
} elseif ( isset( $_POST['checked'] ) ) {
|
||||||
$plugins = (array) $_POST['checked'];
|
$plugins = (array) $_POST['checked'];
|
||||||
} else {
|
} else {
|
||||||
wp_redirect('update-core.php');
|
wp_redirect( admin_url('update-core.php') );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +454,7 @@ if ( 'upgrade-core' == $action ) {
|
|||||||
} elseif ( isset( $_POST['checked'] ) ) {
|
} elseif ( isset( $_POST['checked'] ) ) {
|
||||||
$themes = (array) $_POST['checked'];
|
$themes = (array) $_POST['checked'];
|
||||||
} else {
|
} else {
|
||||||
wp_redirect('update-core.php');
|
wp_redirect( admin_url('update-core.php') );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,9 @@ if ( isset($_GET['action']) ) {
|
|||||||
|
|
||||||
check_admin_referer('activate-plugin_' . $plugin);
|
check_admin_referer('activate-plugin_' . $plugin);
|
||||||
if ( ! isset($_GET['failure']) && ! isset($_GET['success']) ) {
|
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'] ) );
|
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();
|
die();
|
||||||
}
|
}
|
||||||
iframe_header( __('Plugin Reactivation'), true );
|
iframe_header( __('Plugin Reactivation'), true );
|
||||||
|
@ -175,7 +175,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
|
|||||||
if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) {
|
if ( isset($_POST['removewidget']) && $_POST['removewidget'] ) {
|
||||||
|
|
||||||
if ( !in_array($widget_id, $sidebar, true) ) {
|
if ( !in_array($widget_id, $sidebar, true) ) {
|
||||||
wp_redirect('widgets.php?error=0');
|
wp_redirect( admin_url('widgets.php?error=0') );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +208,7 @@ if ( isset($_POST['savewidget']) || isset($_POST['removewidget']) ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
wp_set_sidebars_widgets($sidebars_widgets);
|
wp_set_sidebars_widgets($sidebars_widgets);
|
||||||
wp_redirect('widgets.php?message=0');
|
wp_redirect( admin_url('widgets.php?message=0') );
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -430,7 +430,7 @@ case 'rp' :
|
|||||||
$user = check_password_reset_key($_GET['key'], $_GET['login']);
|
$user = check_password_reset_key($_GET['key'], $_GET['login']);
|
||||||
|
|
||||||
if ( is_wp_error($user) ) {
|
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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -484,12 +484,12 @@ break;
|
|||||||
case 'register' :
|
case 'register' :
|
||||||
if ( is_multisite() ) {
|
if ( is_multisite() ) {
|
||||||
// Multisite uses wp-signup.php
|
// 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;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !get_option('users_can_register') ) {
|
if ( !get_option('users_can_register') ) {
|
||||||
wp_redirect('wp-login.php?registration=disabled');
|
wp_redirect( site_url('wp-login.php?registration=disabled') );
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require('./wp-load.php');
|
require('./wp-load.php');
|
||||||
wp_redirect('wp-login.php?action=register');
|
wp_redirect( site_url('wp-login.php?action=register') );
|
||||||
|
|
||||||
?>
|
?>
|
@ -23,7 +23,7 @@ function signuppageheaders() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( !is_multisite() ) {
|
if ( !is_multisite() ) {
|
||||||
wp_redirect( get_option( 'siteurl' ) . "/wp-login.php?action=register" );
|
wp_redirect( site_url('wp-login.php?action=register') );
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user