Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OreDict entry creation has no input validation #53

Closed
elifoster opened this issue Aug 11, 2017 · 7 comments
Closed

OreDict entry creation has no input validation #53

elifoster opened this issue Aug 11, 2017 · 7 comments

Comments

@elifoster
Copy link
Member

The creation functionality does not perform any checks against the data provided so you can literally put nothing and it will create an entry.

@Alexia
Copy link
Contributor

Alexia commented Aug 11, 2017

I will hold off deploying the current OreDict until this is ready.

@elifoster
Copy link
Member Author

Hm. Upon further investigation this is actually true for the ImportOreDict page too. This also actually brings us back to an old issue, #21, regarding the validation of mod abbreviation inputs.

I think the checks implemented should be as follows:

  • tag name: non-empty
  • item name: non-empty

Regarding the mod abbreviation, I don't know what an adequate check would be. We actually don't perform any checks on the information passed to Tilesheets either (see also).

Regarding the grid params, I also don't know what an adequate check would be. It's not used much to begin with. Do we need any checks for this?

@retep998

@elifoster elifoster changed the title OreDictEntryManager: Creation functionality not safe OreDict entry creation has no input validation Aug 11, 2017
@retep998
Copy link
Member

We should definitely verify that the tag name and item name are non-empty and not just whitespace. Grid parameters are optional so we don't need any sort of check on them.

@elifoster
Copy link
Member Author

What about the mod abbreviation?

@retep998
Copy link
Member

That too. The mod abbreviation definitely should be required and non-empty and not just whitespace.

@elifoster
Copy link
Member Author

Should we provide any additional checks on it though? I know there are specific requirements the tilesheet program (ftb-rs) has that are not actually enforced in either extension.

@elifoster
Copy link
Member Author

elifoster commented Aug 11, 2017

Okay, I looked a bit into stuff. The tag name, item name, and mod abbreviation cannot have any characters that are invalid for a title. They must match $wgLegalTitleChars. See also FTB-Gamepedia/Tilesheets#72.

After this is implemented, someone will need to run a script to check all tile name, tag names, and mod abbreviations that they are valid. For invalid chars, someone will need to manually update the database directly (since invalid characters prevents you from saving any changes after the invalid characters are added).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants