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

Allow to delete IDN via API #2258

Merged
merged 4 commits into from
Jul 14, 2022
Merged

Allow to delete IDN via API #2258

merged 4 commits into from
Jul 14, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Jul 10, 2022

  • What does this PR aim to accomplish?:

If IDN's were added they are converted to punycode before saved in the database. However, when deleting them via API, there was no punycode conversion, which prevented the domain from being deleted.
Fixes #2257

  • How does this PR accomplish the above?:

Convert domains to punycode before trying to delete them.
Note: the domains could already be deleted successfully from the web interface because it didn't use delete_domain_string but delete_domain which uses the database IDs rather than the domain names to identify the database entry.


Additionally, this PR cleans the IDNA conversion a bit by creating two re-usable functions in func.php


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

  • I have read the above and my PR is ready for review. Check this box to confirm

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser added the PR: Code Review Required Open Pull Request, needs code reviewed label Jul 10, 2022
@yubiuser yubiuser requested a review from a team July 10, 2022 21:41
@yubiuser yubiuser linked an issue Jul 10, 2022 that may be closed by this pull request
scripts/pi-hole/php/groups.php Outdated Show resolved Hide resolved
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>

Signed-off-by: yubiuser <ckoenig@posteo.de>
@yubiuser yubiuser requested review from rdwebdesign and a team July 13, 2022 07:15
@yubiuser
Copy link
Member Author

yubiuser commented Jul 13, 2022

Set to hold. Will further simplify.

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser removed the ON HOLD label Jul 13, 2022
@yubiuser
Copy link
Member Author

Created new function in func.php to convert unicode to IDNA ASCII. Ready to go now.

rdwebdesign
rdwebdesign previously approved these changes Jul 13, 2022
Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser merged commit 748b19c into devel Jul 14, 2022
@yubiuser yubiuser deleted the idn branch July 14, 2022 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Code Review Required Open Pull Request, needs code reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't delete entry with non-standard characters from lists using API
2 participants