mirror of
				https://github.com/Mibew/simple-icons.git
				synced 2025-10-31 02:25:59 +03: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.size.hasOwnProperty(iconPath) || | ||||||
|               iconIgnored.center.hasOwnProperty(iconPath) |               iconIgnored.center.hasOwnProperty(iconPath) | ||||||
|             ) { |             ) { | ||||||
|               return |               return; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             const targetCenter = iconSize / 2; |             const targetCenter = iconSize / 2; | ||||||
|  | |||||||
| @ -28,7 +28,7 @@ const { titleToFilename } = require("./utils"); | |||||||
| 
 | 
 | ||||||
| // Local helper functions
 | // Local helper functions
 | ||||||
| function escape(value) { | function escape(value) { | ||||||
|   return value.replace(/'/g, "\\'"); |   return value.replace(/(?<!\\)'/g, "\\'"); | ||||||
| } | } | ||||||
| function iconToKeyValue(icon) { | function iconToKeyValue(icon) { | ||||||
|   const iconTitle = escape(icon.title); |   const iconTitle = escape(icon.title); | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ module.exports = { | |||||||
|      */ |      */ | ||||||
|     htmlFriendlyToTitle: htmlFriendlyTitle => ( |     htmlFriendlyToTitle: htmlFriendlyTitle => ( | ||||||
|       htmlFriendlyTitle |       htmlFriendlyTitle | ||||||
|         .replace(/&/g, "&") |  | ||||||
|         .replace(/'/g, "’") |         .replace(/'/g, "’") | ||||||
|  |         .replace(/&/g, "&") | ||||||
|     ) |     ) | ||||||
| } | } | ||||||
|  | |||||||
| @ -59,7 +59,7 @@ | |||||||
|   //   - https://davidwalsh.name/query-string-javascript
 |   //   - https://davidwalsh.name/query-string-javascript
 | ||||||
|   //   - https://github.com/WebReflection/url-search-params
 |   //   - https://github.com/WebReflection/url-search-params
 | ||||||
|   function getUrlParameter(parameter) { |   function getUrlParameter(parameter) { | ||||||
|     name = parameter.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); |     var name = parameter.replace(/[\[]/g, '\\[').replace(/[\]]/g, '\\]'); | ||||||
|     var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); |     var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'); | ||||||
|     var results = regex.exec(location.search); |     var results = regex.exec(location.search); | ||||||
|     return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); |     return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); | ||||||
| @ -84,9 +84,9 @@ | |||||||
|         queryLetters = query.split(''); |         queryLetters = query.split(''); | ||||||
| 
 | 
 | ||||||
|     var matchedIcons = icons.filter(function(iconName, iconIndex) { |     var matchedIcons = icons.filter(function(iconName, iconIndex) { | ||||||
|       var element = $icons[iconIndex], |       var element = $icons[iconIndex]; | ||||||
|           score = iconName.length - query.length; |       var score = iconName.length - query.length; | ||||||
|           index = 0; |       var index = 0; | ||||||
| 
 | 
 | ||||||
|       for (var i = 0; i < queryLetters.length; i++) { |       for (var i = 0; i < queryLetters.length; i++) { | ||||||
|         var letter = queryLetters[i]; |         var letter = queryLetters[i]; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user