godotengine / godot-asset-library

PHP frontend for Godot Engine's asset library
https://godotengine.org/asset-library
MIT License
291 stars 86 forks source link

Sanitize inputs for Asset data/fields, like URLs #204

Open 2shady4u opened 4 years ago

2shady4u commented 4 years ago

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.

Jummit commented 4 years ago

because of an extra dot '.'

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

2shady4u commented 4 years ago

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

bojidar-bg commented 4 years ago

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",
…
2shady4u commented 4 years ago

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

akien-mga commented 4 years ago

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