cp-psource / pscp-forum

Ein einfaches Tool zum Erstellen eigener Foren, die direkt in jede Seite oder jeden Beitrag eingebettet werden können. / A simple tool for creating your own forums that can be embedded directly into any page or post.
0 stars 0 forks source link

Fix code scanning alert - Unsafe jQuery plugin #2

Closed Dernerd closed 1 year ago

Dernerd commented 1 year ago

Tracking issue for:

Dernerd commented 1 year ago

// Linked elements or callback if (typeof fb.callback === 'object') { // Set background/foreground color $(fb.callback).css({ backgroundColor: DOMPurify.sanitize(fb.color), // Sanitize the color input color: fb.hsl[2] > 0.5 ? '#000' : '#fff' });

// Change linked value
$(fb.callback).each(function() {
    if (this.value && this.value !== DOMPurify.sanitize(fb.color)) { // Sanitize the color input
        this.value = DOMPurify.sanitize(fb.color); // Sanitize the color input
    }
});

} else if (typeof fb.callback === 'function') { fb.callback.call(fb, DOMPurify.sanitize(fb.color)); // Sanitize the color input }