Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit after wp_safe_redirect() #123

Open
jrfnl opened this issue Apr 30, 2021 · 0 comments
Open

Exit after wp_safe_redirect() #123

jrfnl opened this issue Apr 30, 2021 · 0 comments

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Apr 30, 2021

As per the documentation of the wp_safe_redirect() function:

Note: wp_safe_redirect() does not exit automatically, and should almost always be followed by a call to exit;:

wp_safe_redirect( $url );
exit;

Exiting can also be selectively manipulated by using wp_safe_redirect() as a conditional in conjunction with the ‘wp_redirect’ and ‘wp_redirect_location’ filters:

if ( wp_safe_redirect( $url ) ) {
    exit;
}

This plugin currently contains 12 calls to wp_safe_redirect() which are not followed by a call to exit.

As I'm not sure whether this was done so by design, I haven't changed this, but am opening this issue instead.


Details of the calls found without exit (click to open)
FILE: src\admin-debug-info.php                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 83 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\development-mode.php                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 64 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\domain-dropdown.php                                                                                                   
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 77 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\feature-toggler.php                                                                                                   
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 85 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\inline-script.php                                                                                                     
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 88 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\plugin-toggler.php                                                                                                    
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 226 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                      
     |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                          
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\plugin-version-control.php                                                                                            
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 95 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\post-types.php                                                                                                        
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 117 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                      
     |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                          
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\schema.php                                                                                                            
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 121 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                      
     |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                          
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\support-session.php                                                                                                   
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 116 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                      
     |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                          
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\wordpress-plugin-features.php                                                                                         
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 108 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                      
     |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                          
------------------------------------------------------------------------------------------------------------------------        
                                                                                                                                
                                                                                                                                
FILE: src\xml-sitemaps.php                                                                                                      
------------------------------------------------------------------------------------------------------------------------        
FOUND 1 ERROR AFFECTING 1 LINE                                                                                                  
------------------------------------------------------------------------------------------------------------------------        
 93 | ERROR | `wp_safe_redirect()` should almost always be followed by a call to `exit;`.                                       
    |       | (WordPressVIPMinimum.Security.ExitAfterRedirect.NoExit)                                                           
------------------------------------------------------------------------------------------------------------------------        

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant