-
Notifications
You must be signed in to change notification settings - Fork 97
Thellimist/pi 1194 make unicode zones work by punycoding #148
Conversation
src/Cpanel/ClientActions.php
Outdated
@@ -60,15 +61,21 @@ public function mergeCpanelAndCFDomains() | |||
$cpanelDomainList = array_merge($cpanelDomainList, $getCpanelDomains['parked_domains']); | |||
} | |||
|
|||
$Punycode = new Punycode(); |
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.
new
creates a hard coded dependency. Can we do getter/setter DI here and write a test to ensure this method handles unicode domains correctly?
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.
If we ran into this issue on wordpress as well is there a possibility of moving this fix into cloudflare-plugin-backend
so we ensure we handle unicode domains correctly across all plugins?
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.
The fix is dependent on GET /zone?name=something.com
endpoint. cloudflare-plugin-backend
only has generic calls. Max we can do is move the getter/setter of Punycode library there but I think it'd be better if each plugin has it separately unless we moveGET /zone?name=something.com
to cloudflare-plugin-backend
src/Cpanel/ClientActions.php
Outdated
} | ||
|
||
public function setPunycoder($p = null) { | ||
$this->punyCode = $p; |
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.
Normally we put this logic in the getter but it doesn't matter, this approach works as well.
I couldn't use idn-to-ascii function since php needs to be compiled with an extra flag. I assumed we don't have that access and downloaded a library which does it.