Requests to URLs like /sso_for_azure_ad/asdasdfasdf/ always show site content
-
Hello,
Great and simple plugin, thanks.
I noticed the issue which potentialy should be easy to fix.
We found in logs tons of requests to URLs like /sso_for_azure_ad/*/*/*/ …
I tested by my self, and noticed that when I visit the page like /sso_for_azure_ad/some-rundom-string show me the site home page. I expedited it should be 404.Here is a simple fix for that:
function sso_for_azure_ad_handler_template_include( $template ) {
global $wp_query;
$should_stop = false;
$sso_for_azure_ad_query = $wp_query->get( 'sso_for_azure_ad' );
if ( $sso_for_azure_ad_query == 'start' ) {
$should_stop = sso_for_azure_ad_handler_start();
} elseif ( $sso_for_azure_ad_query == 'callback' ) {
$should_stop = sso_for_azure_ad_handler_callback();
}
else {
$wp_query->set_404();
status_header(404);
get_template_part(404);
exit('Not found.');
}
if ( $should_stop ) {
exit;
} else {
return $template;
}
}I am not sure how to contribute back to the WP pluging, looks like wordpress in not realy opensoruce-friendly.
If author can review the code and add it back to the plugin, this would be awesome!
Would be nice if community can review the code also.
You must be logged in to reply to this topic.