godot-asset-library icon indicating copy to clipboard operation
godot-asset-library copied to clipboard

Sanitize inputs for Asset data/fields, like URLs

Open 2shady4u opened this issue 5 years ago • 5 comments

Godot version: 3.2

OS/device including version: Windows 10

Issue description: Since addition of the PSD Importer plugin (by yours truly) the Asset Library throws a malformed URL error because of an extra dot '.' that should not at the end of the URL.

Capture

That additional dot at the end should not be there and is not present in the online website. On the website the icon loads correctly:

Capture

Steps to reproduce: Open the Asset Library, see the error

Minimal reproduction project: Create a new project and open the Asset Library.

2shady4u avatar Mar 08 '20 18:03 2shady4u

because of an extra dot '.'

This is just the end of the sentence. The error is because of something else.

Jummit avatar Mar 08 '20 19:03 Jummit

oh well... Then I don't know what is wrong... The URL does work:

https://raw.githubusercontent.com/2shady4u/godot-psd-importer/master/icon/godot-psd-importer-icon-256x256.png

2shady4u avatar Mar 08 '20 19:03 2shady4u

Looking at the API which the editor uses to get the assets, it seems like the icon URL has an additional TAB character in front:

…
      "icon_url": " \thttps://raw.githubusercontent.com/2shady4u/godot-psd-importer/master/icon/godot-psd-importer-icon-256x256.png",
…

bojidar-bg avatar Mar 09 '20 10:03 bojidar-bg

Ah... I see.. Okay I have edited the Asset and removed this unnecessary tab character.

2shady4u avatar Mar 09 '20 10:03 2shady4u

We should probably strip non-printable characters from all inputs.

akien-mga avatar Mar 09 '20 11:03 akien-mga