• Resolved Dima

    (@dimastorozhuk)


    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marco

    (@qlcvea)

    Hello,

    I have implemented a fix in the new 2.5.2 release of this plugin.

    Thread Starter Dima

    (@dimastorozhuk)

    @qlcvea What exectly did you do? I see a lot of unrelated changes.
    The changes that you made completely diffrent from what I sugegsted.

    Is there any change log?

    Plugin Author Marco

    (@qlcvea)

    Hello,

    I refactored the whole file to remove some return values that would cause the template handler to continue to the default template, thus ensuring it never does (when handling an sso_for_azure_ad URL) and always returns appropriate errors instead.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.