-
Notifications
You must be signed in to change notification settings - Fork 718
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
[GUI][BUG] Properly validate proposal creation Name/URL #2760
[GUI][BUG] Properly validate proposal creation Name/URL #2760
Conversation
Let the validation methods give length warnings
This matches the behavior provided by the RPC interface to prevent illegal characters from being included in either a proposal's name or URL
clang-tidy: can use a raw string literal instead of an escaped string for better readability.
Future implementation of string validation on the network level for proposal name/URL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK dc11219
Compiled and tested using -regtest
Adding special characters to proposal name or URL changed outline of box to RED and error message appeared.
No issue adding proper name/URL.
Name is limited to 20 char
URL is limited to 64 char
all as intended. the red outline indicates an issue, and trying to continue via the button will display the actual error message in the UI and will not allow further progress until the issue(s) are fixed. |
utACK dc11219 Reviewed the code. The overall approach to validation looks good, the new url-matching regular expression looks better, and string passing by const reference adds clarity. |
Remove the hard input cap of the name/URL inputs in the proposal creation UI so that the underlaying validation methods can give visual feedback when input lengths are too long (prevents silent cut-offs when pasting a too-long string).
Sanitize both fields to ensure that no illegal characters are accepted, matching the RPC interface's functionality.
introduce a future-forward (not yet implemented) method of verifying name/url fields on the network level.