From f035ac9b205b25494a55fb2f4d1a74f7b4206a4a Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 29 Jan 2006 23:06:58 +0000 Subject: [PATCH] Make check_admin_referer() pluggable. git-svn-id: http://svn.automattic.com/wordpress/trunk@3497 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 8 -------- wp-includes/pluggable-functions.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 0828d677f..23eade17a 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -966,14 +966,6 @@ function touch_time($edit = 1, $for_post = 1) { } -function check_admin_referer() { - $adminurl = strtolower(get_settings('siteurl')).'/wp-admin'; - $referer = strtolower($_SERVER['HTTP_REFERER']); - if (!strstr($referer, $adminurl)) - die(__('Sorry, you need to enable sending referrers for this feature to work.')); - do_action('check_admin_referer'); -} - // insert_with_markers: Owen Winkler, fixed by Eric Anderson // Inserts an array of strings into a file (.htaccess), placing it between // BEGIN and END markers. Replaces existing marked info. Retains surrounding diff --git a/wp-includes/pluggable-functions.php b/wp-includes/pluggable-functions.php index e4b131d2d..bcaa9a887 100644 --- a/wp-includes/pluggable-functions.php +++ b/wp-includes/pluggable-functions.php @@ -223,6 +223,16 @@ function auth_redirect() { } endif; +if ( !function_exists('check_admin_referer') ) : +function check_admin_referer() { + $adminurl = strtolower(get_settings('siteurl')).'/wp-admin'; + $referer = strtolower($_SERVER['HTTP_REFERER']); + if (!strstr($referer, $adminurl)) + die(__('Sorry, you need to enable sending referrers for this feature to work.')); + do_action('check_admin_referer'); +} +endif; + // Cookie safe redirect. Works around IIS Set-Cookie bug. // http://support.microsoft.com/kb/q176113/ if ( !function_exists('wp_redirect') ) :