Skip to content

Commit

Permalink
fix(affix): XSS on target config
Browse files Browse the repository at this point in the history
  • Loading branch information
don-spyker authored and Dominik Speicher committed Aug 10, 2018
1 parent 5c71ecf commit ae29b6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/affix.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
var Affix = function (element, options) {
this.options = $.extend({}, Affix.DEFAULTS, options)

this.$target = $(this.options.target)
var target = this.options.target === Affix.DEFAULTS.target ? $(this.options.target) : $(document).find(this.options.target)

this.$target = target
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))

Expand Down

0 comments on commit ae29b6a

Please # to comment.