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

    That is far from sufficient as a URL regex. Consider, for example, the URL https://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.

    Edited 27 Sept 2017: Re-tested the plugin and found the original issue is now resolved, review adjusted accordingly.

    This plugin is simple and intuitive, exactly what a good plugin should be. It does what it says on the tin with the minimum of fuss, great plugin.

    • This topic was modified 7 years, 1 month ago by Matt Lowe. Reason: Original issue is resolved so changed review to reflect this
    • This topic was modified 7 years, 1 month ago by Matt Lowe.
Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Thread Starter Matt Lowe

    (@squelch)

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

    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.