WordPress.org

Support

Support » Reviews » Remove Dashboard Access » Only works on FQDNs

Only works on FQDNs

  • 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.

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

    @drewapicture

    Docs Czar

    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.

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

    Plugin Author Drew Jaynes

    @drewapicture

    Docs Czar

    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;

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Only works on FQDNs’ is closed to new replies.
Skip to toolbar