Remove Dashboard Access
Only works on FQDNs (4 posts)

  1. Matt Lowe
    Posted 3 years ago #

    elseif ( ! preg_match( '|^\S+://\S+\.\S+.+$|', $options['redirect_url'] ) )

    That is far from sufficient as a URL regex. Consider, for example, the URL http://localhost/~squelch which is perfectly valid. As a developer I need to test things before they go live.

    It's a shame as this looks like it could be a good solution. If/when this gets fixed I'll be more than happy to revise my rating.

  2. Drew Jaynes
    Docs Czar
    Plugin Author

    Posted 3 years ago #

    Hi Matt,

    I agree with you on the regex. In fact, looking back at it, I'm not really sure why I added it in.

    I'm thinking it was because I managed to lock myself out of the Dashboard while testing it because of a poorly-formed URL. The only way to remedy that, of course, was to force loggedout=true and/or delete the cookie for the test user.

    So in short, the regex will be going away in the next version — 1.3 — which should be out soon. I'm just wrapping up a couple of other requested features. I'll post back here when that's released.

  3. Matt Lowe
    Posted 3 years ago #

    Nice one, I look forward to seeing the new version! And apologies for the somewhat confrontational tone, I was having a REALLY bad day!

  4. Drew Jaynes
    Docs Czar
    Plugin Author

    Posted 3 years ago #

    We all have them, no worries. I'd forgotten what it's like to test on localhost without mapped domains. For instance, I test on localhost trunk and latest builds mapped to URLs like trunk.dev and 35.dev ;)

    I'll probably just simplify sans regex:

    $redirect_url = empty( $options['redirect_url'] ) ? home_url() : esc_url_raw( $options['redirect_url'] );
    $options['redirect_url'] = $redirect_url;

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Remove Dashboard Access
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.