From 5d42dae38063455869d79eee583c5989c09b65a5 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Wed, 18 Oct 2006 22:02:30 +0000 Subject: [PATCH] Add wp_redirect filter, with cancel ability. fixes #3250 git-svn-id: http://svn.automattic.com/wordpress/trunk@4407 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/pluggable.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index f733359ad..c81f575b6 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -256,6 +256,11 @@ if ( !function_exists('wp_redirect') ) : function wp_redirect($location, $status = 302) { global $is_IIS; + $location = apply_filters('wp_redirect', $location, $status); + + if ( !$location ) // allows the wp_redirect filter to cancel a redirect + return false; + $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location); $location = wp_kses_no_null($location);