Feat: extend image validity check to inlcude nui URIs#84
Feat: extend image validity check to inlcude nui URIs#84Maximus7474 wants to merge 3 commits intoCommunityOx:mainfrom
Conversation
|
@FjamZoo any opinion on the whitelist blacklisting of urls ? |
It looks pretty good as is, and yes we would need to make this happen through convars like most other configurations inside of ox_inventory. |
|
I'll add it to this PR with it being in the same scope. |
|
Would it be better to always have the valid img url checks even if no webhook ? Have it at least log in the console when an invalid use occurs ? https://github.com/CommunityOx/ox_inventory/blob/main/modules/items/server.lua#L235-L242 |
This pull request extends the check made by the server utility function
Utils.IsValidImageUrlto also allow nui URI asimageurlin item metadata when the moderation log is enabled, it splits the check into two steps checking first if it's an nui URI then if it's a valid URL.This PR addresses #58 issue, opens the door for easier freedom of use even if it doesn't seem like many servers use the feature.
Could be considered to have the validity check being always listed or as a separate convar to enable.
To be noted, this module requires some more attention, the valid hosts element for URL image checks still only lists 'imgur' as default valid source and needs changing being that imgur links do not function within nui.
My recommendation is to alter it to have a blacklist and a whitelist module, blacklisting by default discord and imgur urls (both do not work for fivem) and having an empty whitelist hash table. If there aren't any values for whitelisted domains
Example implementation: