mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Clean up web interface storage tab.
- Use diffing algorithm so you can select text and images.
- This uses textcontent, plugs a vulnerability where you could inject arbitrary javascript if you could upload a modded item with html in the name, eg, "iron-plate<img src=\"\" onerror=\"console.log('hi')\">".
- Fall back to transparent png if item image not found.
- This stops the flashing box when the image does not exist.
- (internal) Simplify `sortByKey(array, key)`.
This commit is contained in:
1 parent
d01914f7b2
commit
bdf4225dec
4 files changed
+31
-14
No files matched your search
+1
-1
@@ -78,7 +78,7 @@ function getImageFromName(name){
|
||||
return "https://wiki.factorio.com/images/" + capitalizeFirstLetter(replaceAll(factorioLocale["fluid-name"][name], ' ', '_').toLowerCase()) + ".png";
|
||||
} else if(factorioLocale["equipment-name"] && factorioLocale["equipment-name"][name]){
|
||||
return "https://wiki.factorio.com/images/" + capitalizeFirstLetter(replaceAll(factorioLocale["equipment-name"][name], ' ', '_').toLowerCase()) + ".png";
|
||||
} else return "";
|
||||
} else return "/pictures/unknown-item.png";
|
||||
}
|
||||
window.factorioLocale = {};
|
||||
$.getJSON("/api/getFactorioLocale", (locale) => {
|
||||
|
||||
Reference in new issue
Block a user