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

Trim user input where applicable #1293

Merged
merged 1 commit into from
May 14, 2020
Merged

Trim user input where applicable #1293

merged 1 commit into from
May 14, 2020

Conversation

jacklul
Copy link
Contributor

@jacklul jacklul commented May 14, 2020

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:

Make life easier for people who copy & paste values into fields.

Trims user input fields:

  • groups-clients.php view
    • #ip-custom field (groups-client.js:254), it's trimmed in groups.php:242 so it doesn't make sense to not trim it here
  • settings.php?tab=dns view
    • conditionalForwardingIP and conditionalForwardingDomain
    • custom DNS fields
  • settings.php?tab=piholedhcp view
    • from, to, router, domain, leasetime
    • AddMAC, AddIP, AddHostname
  • dns_records.php view
    • ip and domain

Some of those changes were in #825 but the PR was closed.

How does this PR accomplish the above?:

Added trim() calls in appropriate places

What documentation changes (if any) are needed to support this PR?:

None

I think I got all of them ? Other fields (whitelist/blacklist) are trimmed already.

@DL6ER DL6ER merged commit a3df25c into pi-hole:devel May 14, 2020
@PromoFaux PromoFaux mentioned this pull request Jul 5, 2020
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-5-1-released/35577/1

@jacklul jacklul deleted the patch-2 branch April 14, 2024 07:26
@jacklul jacklul restored the patch-2 branch April 14, 2024 07:26
@jacklul jacklul deleted the patch-2 branch April 14, 2024 07:27
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

Successfully merging this pull request may close these issues.

3 participants