Skip to content

Commit 025d042

Browse files
committed
Always exit after wp_redirect
As the SSO plugin should be the autoritative login solution running on a site, it should enforce redirection in case it's needed. This commit replaced `return false;` with `exit;` in `saml_lostpassword` and `saml_user_register` functions. That way, we make sure the redirection happens early and would be the very last action of the HTTP request in WordPress. See https://developer.wordpress.org/reference/functions/wp_redirect/
1 parent 1e07ba4 commit 025d042

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

onelogin-saml-sso/php/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ function saml_lostpassword() {
4747
$target = get_option('onelogin_saml_customize_links_lost_password');
4848
if (!empty($target)) {
4949
wp_redirect($target);
50-
return false;
50+
exit;
5151
}
5252
}
5353

5454
function saml_user_register() {
5555
$target = get_option('onelogin_saml_customize_links_user_registration');
5656
if (!empty($target)) {
5757
wp_redirect($target);
58-
return false;
58+
exit;
5959
}
6060
}
6161

0 commit comments

Comments
 (0)