Add wp_redirect filter, with cancel ability. fixes #3250
git-svn-id: http://svn.automattic.com/wordpress/trunk@4407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
514b7a3415
commit
5d42dae380
|
@ -256,6 +256,11 @@ if ( !function_exists('wp_redirect') ) :
|
||||||
function wp_redirect($location, $status = 302) {
|
function wp_redirect($location, $status = 302) {
|
||||||
global $is_IIS;
|
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 = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);
|
||||||
$location = wp_kses_no_null($location);
|
$location = wp_kses_no_null($location);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue