Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
  • Loading branch information...
commit 4f3b9f7b7f7aaa548f0251277f24749386164d4f 1 parent 432f2a4
dd32 authored
View
2  wp-admin/admin.php
@@ -126,7 +126,7 @@
$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
2  wp-admin/import.php
@@ -37,7 +37,7 @@
);
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
2  wp-admin/link.php
@@ -24,7 +24,7 @@
if ( !empty($_POST['linkcheck']) )
$linkcheck = $_POST['linkcheck'];
-$this_file = 'link-manager.php';
+$this_file = admin_url('link-manager.php');
switch ($action) {
case 'deletebookmarks' :
View
4 wp-admin/media.php
@@ -48,7 +48,7 @@
$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 @@
exit;
default:
- wp_redirect( 'upload.php' );
+ wp_redirect( admin_url('upload.php') );
exit;
endswitch;
View
2  wp-admin/moderation.php
@@ -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
6 wp-admin/plugin-editor.php
@@ -67,9 +67,9 @@
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 @@
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
4 wp-admin/post.php
@@ -138,7 +138,7 @@ function redirect_post($post_id = '') {
$editing = true;
if ( empty( $post_id ) ) {
- wp_redirect("post.php");
+ wp_redirect( admin_url('post.php') );
exit();
}
@@ -265,7 +265,7 @@ function redirect_post($post_id = '') {
break;
default:
- wp_redirect('edit.php');
+ wp_redirect( admin_url('edit.php') );
exit();
break;
} // end switch
View
4 wp-admin/themes.php
@@ -16,14 +16,14 @@
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
4 wp-admin/update-core.php
@@ -431,7 +431,7 @@ function no_update_actions($actions) {
} 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 @@ function no_update_actions($actions) {
} elseif ( isset( $_POST['checked'] ) ) {
$themes = (array) $_POST['checked'];
} else {
- wp_redirect('update-core.php');
+ wp_redirect( admin_url('update-core.php') );
exit;
}
View
4 wp-admin/update.php
@@ -70,9 +70,9 @@
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
4 wp-admin/widgets.php
@@ -175,7 +175,7 @@ function retrieve_widgets() {
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 @@ function retrieve_widgets() {
}
wp_set_sidebars_widgets($sidebars_widgets);
- wp_redirect('widgets.php?message=0');
+ wp_redirect( admin_url('widgets.php?message=0') );
exit;
}
View
6 wp-login.php
@@ -430,7 +430,7 @@ function register_new_user( $user_login, $user_email ) {
$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 @@ function register_new_user( $user_login, $user_email ) {
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
2  wp-register.php
@@ -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
2  wp-signup.php
@@ -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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.