From 06dae5ed28e7ddb231cfc0dfb5cd3f9b5d8a9e5f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 15 Feb 2008 22:29:18 +0000 Subject: [PATCH] Clean up URL and redirect after GET posts git-svn-id: https://develop.svn.wordpress.org/trunk@6863 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/categories.php | 5 +++++ wp-admin/edit-link-categories.php | 3 +++ wp-admin/edit-pages.php | 3 +++ wp-admin/edit-tags.php | 5 +++++ wp-admin/link-manager.php | 3 +++ 5 files changed, 19 insertions(+) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index bd76bdf264..af712855ff 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -95,6 +95,11 @@ break; default: +if ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; +} + wp_enqueue_script( 'admin-categories' ); wp_enqueue_script('admin-forms'); diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index 8d58965385..0d1685fc43 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -20,6 +20,9 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { wp_redirect('edit-link-categories.php?message=6'); exit(); +} elseif ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; } $title = __('Link Categories'); diff --git a/wp-admin/edit-pages.php b/wp-admin/edit-pages.php index 3020ff12f7..d0a2563bc9 100644 --- a/wp-admin/edit-pages.php +++ b/wp-admin/edit-pages.php @@ -26,6 +26,9 @@ if ( isset($_GET['deleteit']) && isset($_GET['delete']) ) { wp_redirect($sendback); exit(); +} elseif ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; } $title = __('Pages'); diff --git a/wp-admin/edit-tags.php b/wp-admin/edit-tags.php index 92c93842eb..579dc6c649 100644 --- a/wp-admin/edit-tags.php +++ b/wp-admin/edit-tags.php @@ -85,6 +85,11 @@ break; default: +if ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; +} + wp_enqueue_script( 'admin-tags' ); wp_enqueue_script('admin-forms'); diff --git a/wp-admin/link-manager.php b/wp-admin/link-manager.php index 4c9ee02437..dd853809ae 100644 --- a/wp-admin/link-manager.php +++ b/wp-admin/link-manager.php @@ -19,6 +19,9 @@ if ( isset($_GET['deleteit']) && isset($_GET['linkcheck']) ) { $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); wp_redirect($sendback); exit; +} elseif ( !empty($_GET['_wp_http_referer']) ) { + wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']))); + exit; } wp_enqueue_script( 'wp-lists' );