#33245 closed defect (bug) (invalid)
4.3 - Invalid arguments passed to wp_validate_redirect within wp_safe_redirect()
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.3 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
File: pluggable.php
Line: 1284
Function: wp_safe_redirect()
Current/Bug:
$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) );
Fix:
$location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url() ), $status );
Reasoning:
The $status is being passed to the new 'wp_safe_redirect_fallback' filter as the 3rd parameter (which doesn't exist). It should be passed to wp_validate_redirect() as its 2nd parameter
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi Paul, thanks for bring this up!
Hook callbacks, no matter whether they are action or filter callbacks, will get all arguments passed on to them that are defined after the name of the hook (in this case
wp_safe_redirect_fallback
). So the only arguments it gets isadmin_url()
and$status
.From the function documentation of
apply_filters()
: