commands icon indicating copy to clipboard operation
commands copied to clipboard

User is able to input empty String.

Open Articdive opened this issue 6 years ago • 5 comments

It might only be for the console I haven't had enough time to test this issue as of yet but by using 2 spaces in a String input for example: "loot collection add %String% %Integer%" if you run "/loot collection add 100 "(probability will resolve to 100 and %String% will resolve to an empty String as there are 2 spaces between add and 100 (GitHub does actually trim it in the above example). Could we add an annotation to make sure that that string is not allowed to resolve to "" or just generally not make it resolvable to empty strings.

I am aware of me being able to add a command condition to not allow this, but I would consider it a bug first.

Articdive avatar Jun 14 '19 18:06 Articdive

I can't reproduce your issue. Can you provide a example BaseCommand class for that case?

What MC/Spigot/Paper Version do you use?

Joo200 avatar Jun 14 '19 19:06 Joo200

I can't reproduce your issue. Can you provide a example BaseCommand class for that case?

What MC/Spigot/Paper Version do you use?

1.14.2 - Spigot-df0eb25-43431ba, So I can give you a method from my use case, note that Loot is a context that is resolved. https://hasteb.in/madiduhe.java

Articdive avatar Jun 14 '19 20:06 Articdive

Can you paste your context resolver?

Joo200 avatar Jun 14 '19 20:06 Joo200

Can you paste your context resolver?

https://hasteb.in/apupiqan.swift (It's java not swift god damnit hastebin.)

EDIT: If it helps I'm using the PaperCommandManager.

Articdive avatar Jun 14 '19 20:06 Articdive

Okay, you're right. The console can use two whitespaces and create a empty string. This is propably a bug in acf, i don't like the idea to add a new annotation.

Player can't use two whitespaces for an empty string. I guess the client doesn't send doubled whitespaces to the server.

Joo200 avatar Jun 14 '19 21:06 Joo200