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

[GUI][BUG] Properly validate proposal creation Name/URL #2760

Merged

Conversation

Fuzzbawls
Copy link
Collaborator

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.

Fuzzbawls added 5 commits May 15, 2022 23:20
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
@Fuzzbawls Fuzzbawls added GUI Bug Needs Backport Placeholder tag for anything needing a backport to prior version branches labels May 16, 2022
@Fuzzbawls Fuzzbawls added this to the 6.0.0 milestone May 16, 2022
@Fuzzbawls Fuzzbawls self-assigned this May 16, 2022
Copy link

@DeanSparrow DeanSparrow left a 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

@Fuzzbawls
Copy link
Collaborator Author

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.

@Fuzzbawls Fuzzbawls modified the milestones: 6.0.0, 5.5.0 Jul 30, 2022
@yenachar
Copy link

yenachar commented Sep 17, 2022

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.

@Fuzzbawls Fuzzbawls removed the Needs Backport Placeholder tag for anything needing a backport to prior version branches label Sep 17, 2022
@Fuzzbawls Fuzzbawls merged commit 4c466f4 into PIVX-Project:master Sep 21, 2022
@Fuzzbawls Fuzzbawls added Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes and removed Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes labels Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants