Skip to content

Commit

Permalink
slight cleanup of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
danslo committed Jan 8, 2025
1 parent b15c1ba commit 47999a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion woocommerce.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (w *WooCommerce) BaseURLs(ctx context.Context, docroot string) ([]string, e
}

func (w *WooCommerce) Version(docroot string) (string, error) {
re := regexp.MustCompile(`\$wp_version\s*=\s*'([^']*)'`)
re := regexp.MustCompile(`\$wp_version\s*=\s*'([^']+)';`)
data, err := os.ReadFile(filepath.Join(docroot, "wp-includes", "version.php"))
if err != nil {
return "", err
Expand Down

0 comments on commit 47999a8

Please sign in to comment.