mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-26 01:00:27 +02:00
Fix low severity issues in the JavaScript (#3342)
This commit is contained in:
parent
d4b07ad447
commit
7fb4ff6395
@ -90,7 +90,7 @@ module.exports = {
|
||||
iconIgnored.size.hasOwnProperty(iconPath) ||
|
||||
iconIgnored.center.hasOwnProperty(iconPath)
|
||||
) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
|
||||
const targetCenter = iconSize / 2;
|
||||
|
@ -28,7 +28,7 @@ const { titleToFilename } = require("./utils");
|
||||
|
||||
// Local helper functions
|
||||
function escape(value) {
|
||||
return value.replace(/'/g, "\\'");
|
||||
return value.replace(/(?<!\\)'/g, "\\'");
|
||||
}
|
||||
function iconToKeyValue(icon) {
|
||||
const iconTitle = escape(icon.title);
|
||||
|
@ -32,7 +32,7 @@ module.exports = {
|
||||
*/
|
||||
htmlFriendlyToTitle: htmlFriendlyTitle => (
|
||||
htmlFriendlyTitle
|
||||
.replace(/&/g, "&")
|
||||
.replace(/'/g, "’")
|
||||
.replace(/&/g, "&")
|
||||
)
|
||||
}
|
||||
|
@ -59,7 +59,7 @@
|
||||
// - https://davidwalsh.name/query-string-javascript
|
||||
// - https://github.com/WebReflection/url-search-params
|
||||
function getUrlParameter(parameter) {
|
||||
name = parameter.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
||||
var name = parameter.replace(/[\[]/g, '\\[').replace(/[\]]/g, '\\]');
|
||||
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
|
||||
var results = regex.exec(location.search);
|
||||
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
|
||||
@ -84,9 +84,9 @@
|
||||
queryLetters = query.split('');
|
||||
|
||||
var matchedIcons = icons.filter(function(iconName, iconIndex) {
|
||||
var element = $icons[iconIndex],
|
||||
score = iconName.length - query.length;
|
||||
index = 0;
|
||||
var element = $icons[iconIndex];
|
||||
var score = iconName.length - query.length;
|
||||
var index = 0;
|
||||
|
||||
for (var i = 0; i < queryLetters.length; i++) {
|
||||
var letter = queryLetters[i];
|
||||
|
Loading…
Reference in New Issue
Block a user