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
  • Merge requests
  • !3421

Add html option to popover/tooltip

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/pcorsaro/master into master May 10, 2012
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 3

Created by: pcorsaro

There is an html option for popover/tooltip again. The option is defaulted to true.

Having this option allows us to force the popover to use the .text() method to set the title and content of the popover no matter if bootstrap thinks it detects html or not. The problem is that jQuery seems to unescape values grabbed with the .attr() method, so even if you escape <script>alert('data');</script> to &lt;script&gt;alert(&quot;data&quot;)&lt;/script&gt; and set it as your data-content, bootstrap will get the unescaped value from .attr(), detect that this is html and use the .html() method to set the content of the popover causing an XSS issue. Forcing the use of the .text() method by setting the html option to false lets us make sure that doesn't happen.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/pcorsaro/master