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

Guest share block domains should have input validation in admin panel #497

Open
mrow4a opened this issue Apr 27, 2022 · 1 comment
Open

Comments

@mrow4a
Copy link
Contributor

mrow4a commented Apr 27, 2022

per @phil-davis comment:
The string value is supposed to be a comma-separated list. But I can put in spaces between domain names, and I can enter any characters at all (that do not look like domain names)

We could:

do some easy automatic formatting (e.g. replace whitespace with commas, trim whitespace at beginning and end)
add some text to say that a comma-separated list of domain names is expected to be entered
(optional?) process the domain names through some "reasonable" validator to confirm that they are "valid" (the validator needs to accept less usual things like an IP address, "localhost" etc so that test/development installations can try local things)
I tested the code manually and it is working - any existing value is displayed, any change is correctly saved. I created issue #496 for an automated test and put it on our QA board. There is no need to block merging here.

ref.

guests/js/guests.js

Lines 124 to 129 in 69e01eb

var saveShareBlockDomains = function () {
// FIXME: do validations here to make sure valid input is passed
// and valid domains
config.shareBlockDomains = $guestSharingBlockDomains.val().trim();
saveConfig();
}

@mrow4a
Copy link
Contributor Author

mrow4a commented Apr 27, 2022

FYI @pmaier1

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

No branches or pull requests

1 participant