]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
ES5 fixes.
authorXhmikosR <xhmikosr@gmail.com>
Tue, 12 Feb 2019 15:30:11 +0000 (17:30 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 13 Feb 2019 15:55:38 +0000 (17:55 +0200)
js/tooltip.js

index bd6252ff3b6326e24b41272e597014d28a64cfdb..e605cd99ca3c909b29f08c91181a41f2015da818 100644 (file)
@@ -74,7 +74,7 @@
   var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i
 
   function allowedAttribute(attr, allowedAttributeList) {
-    const attrName = attr.nodeName.toLowerCase()
+    var attrName = attr.nodeName.toLowerCase()
 
     if ($.inArray(attrName, allowedAttributeList) !== -1) {
       if ($.inArray(attrName, uriAttrs) !== -1) {
     var createdDocument = document.implementation.createHTMLDocument('sanitization')
     createdDocument.body.innerHTML = unsafeHtml
 
-    var whitelistKeys = Object.keys(whiteList)
+    var whitelistKeys = $.map(whiteList, function (el, i) { return i })
     var elements = $(createdDocument.body).find('*')
 
     for (var i = 0, len = elements.length; i < len; i++) {
       var attributeList = $.map(el.attributes, function (el) { return el })
       var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
 
-      attributeList.forEach((attr) => {
-        if (!allowedAttribute(attr, whitelistedAttributes)) {
-          el.removeAttribute(attr.nodeName)
+      for (var j = 0, len2 = attributeList.length; j < len2; j++) {
+        if (!allowedAttribute(attributeList[j], whitelistedAttributes)) {
+          el.removeAttribute(attributeList[j].nodeName)
         }
-      })
+      }
     }
 
     return createdDocument.body.innerHTML
   }
 
   Tooltip.prototype.getOptions = function (options) {
-    const dataAttributes = this.$element.data()
+    var dataAttributes = this.$element.data()
 
     for (var dataAttr in dataAttributes) {
       if (dataAttributes.hasOwnProperty(dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
     }
 
     if (options.sanitize) {
-      config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn)
+      options.template = sanitizeHtml(options.template, options.whiteList, options.sanitizeFn)
     }
 
     return options