Skip to content

Commit

Permalink
fix: Fix regex to allow >3 char TLDs (fixes rosswintle#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsit committed May 4, 2024
1 parent 6e6f607 commit 48c02be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class-sync-mastodon-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function handle_submission() {
check_admin_referer( 'sync-mastodon-settings' );

// To validate the API token is just a URL
$valid_url_regex = '/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?$/';
$valid_url_regex = '/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}(\/\S*)?$/';

if ( isset( $_POST['rss-url'] )
&& 1 === preg_match( $valid_url_regex, $_POST['rss-url'] )
Expand Down

0 comments on commit 48c02be

Please sign in to comment.