Skip to content

Commit e6939ce

Browse files
AsifNawaz-cnicKaiSchwarz-cnic
authored andcommitted
fix(responsetranslator.php): updated response messages when premium price is not available
1 parent 49ed02c commit e6939ce

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/HEXONET/ResponseTranslator.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class ResponseTranslator
2323
* @var array
2424
*/
2525
private static $descriptionRegexMap = [
26+
// HX
2627
"Authorization failed; Operation forbidden by ACL" => "Authorization failed; Used Command `{COMMAND}` not white-listed by your Access Control List",
2728
"Request is not available; DOMAIN TRANSFER IS PROHIBITED BY STATUS (clientTransferProhibited)/WRONG AUTH" => "This Domain is locked and the given Authorization Code is wrong. Initiating a Transfer is therefore impossible.",
2829
"Request is not available; DOMAIN TRANSFER IS PROHIBITED BY STATUS (clientTransferProhibited)" => "This Domain is locked. Initiating a Transfer is therefore impossible.",
@@ -32,8 +33,12 @@ class ResponseTranslator
3233
"Request is not available; DOMAIN TRANSFER IS PROHIBITED BY STATUS (pendingdelete)" => "Deletion of this Domain Name is pending. Initiating a Transfer is therefore impossible.",
3334
"Request is not available; DOMAIN TRANSFER IS PROHIBITED BY WRONG AUTH" => "The given Authorization Code is wrong. Initiating a Transfer is therefore impossible.",
3435
"Request is not available; DOMAIN TRANSFER IS PROHIBITED BY AGE OF THE DOMAIN" => "This Domain Name is within 60 days of initial registration. Initiating a Transfer is therefore impossible.",
36+
// CNR
37+
"Missing required attribute; premium domain name. please provide required parameters" => "Confirm the Premium pricing by providing the necessary premium domain price data.",
3538
"SkipPregQuote" => [
36-
"Invalid attribute value syntax; resource record \[(.+)\]" => "Invalid Syntax for DNSZone Resource Record: $1"
39+
// HX
40+
"Invalid attribute value syntax; resource record \[(.+)\]" => "Invalid Syntax for DNSZone Resource Record: $1",
41+
"Missing required attribute; CLASS(?:=| \[MUST BE )PREMIUM_([\w\+]+)[\s\]]" => "Confirm the Premium pricing by providing the parameter CLASS with the value PREMIUM_$1.",
3742
]
3843
];
3944

@@ -127,7 +132,7 @@ protected static function findMatch($regex, &$newraw, $val, $cmd, $ph)
127132
// match the response for given description
128133
// NOTE: we match if the description starts with the given description
129134
// it would also match if it is followed by additional text
130-
$qregex = "/description=" . $regex . "([^\\r\\n]+)?/i";
135+
$qregex = "/description\s*=\s*" . $regex . "([^\\r\\n]+)?/i";
131136
$return = false;
132137

133138
if (preg_match($qregex, $newraw)) {

0 commit comments

Comments
 (0)