Skip to content

Commit

Permalink
Unset action and use add_query_arg() to properly add query args.
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Jul 15, 2022
1 parent a67c88f commit d2faf8f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion includes/SSO_Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public static function getSuccessUrl() {
if ( $url ) {
$params = $_GET;

unset( $params['action'] );
unset( $params['bounce'] );
unset( $params['nonce'] );
unset( $params['redirect'] );
Expand All @@ -200,7 +201,12 @@ public static function getSuccessUrl() {
unset( $params['user'] );

// Persist all query params not used for SSO
$url .= $params ? '?' . http_build_query( $params ) : '';
if ( ! empty( $params ) ) {
foreach ( $params as $key => $value ) {
$url = add_query_arg( $key, $value, $url );
}
}

}

if ( ! $url ) {
Expand Down

0 comments on commit d2faf8f

Please sign in to comment.