Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #18641
Closed
Open
Issue created Dec 23, 2015 by Administrator@rootContributor

Regex in Util.getSelectorFromElement is too restrictive

Created by: ditiem

In this line (v4-alpha code)

tab.js: 90: let selector = Util.getSelectorFromElement(this._element)

decided which pane will be selected when clicking on the "tab". Inside the getSelectorFromElement, if not data-target is provided, the href attribute is inspected. In order to decide if the selector is valid, a regular expression is used.

I generated a "fake uuid" in my code and found out:

/^#[a-z]/i.test("#8828a412-2185-4d9c-9073-81272784c4a1") returns false

/^#[a-z]/i.test("#e58329c1-e759-4661-9ae9-c33a12b8c0b6") returns true

(the reason is that in the first selector the first character is a number rather than a letter.)

So sometimes the tab was selected and sometimes not!

An expression like /^#[a-z1-9]/i should work, but I suspect there will be more cases to take into consideration.

Assignee
Assign to
Time tracking