Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class JiraRepository extends BaseRepositoryImpl {
private static final boolean BASIC_AUTH_ONLY = Boolean.getBoolean("tasks.jira.basic.auth.only");
private static final boolean REDISCOVER_API = Boolean.getBoolean("tasks.jira.rediscover.api");

public static final Pattern JIRA_ID_PATTERN = Pattern.compile("\\p{javaUpperCase}+-\\d+");
public static final Pattern JIRA_ID_PATTERN = Pattern.compile("[\\p{javaUpperCase}\\p{Digit}_]+-\\d+");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Regex allows JIRA IDs starting with digits or underscores

The updated JIRA_ID_PATTERN regex now matches strings like 123-456 or ___-123 because it allows digits and underscores as the first character. JIRA project keys must start with a letter, so the pattern should enforce that the first character is an uppercase letter, with digits and underscores allowed only in subsequent positions. This could cause unnecessary API calls when user input like 123-456 incorrectly matches the pattern.

Fix in Cursor Fix in Web

public static final String AUTH_COOKIE_NAME = "JSESSIONID";

/**
Expand Down Expand Up @@ -459,4 +459,4 @@ public void setJiraVersion(@Nullable String jiraVersion) {
public String getRestUrl(String... parts) {
return getUrl() + REST_API_PATH + "/" + StringUtil.join(parts, "/");
}
}
}