Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
fix(tldlib): review tldlib and its usage
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiSchwarz-cnic committed Apr 8, 2019
1 parent f2de89d commit cbc8018
Show file tree
Hide file tree
Showing 2 changed files with 288 additions and 229 deletions.
8 changes: 5 additions & 3 deletions ispapidpi.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,18 @@ function collect_tld_register_transfer_renew_currency($r)
foreach (preg_grep($pattern_for_tldclass, $r["PROPERTY"]["RELATIONTYPE"]) as $ctype) {
$tldclass = preg_replace("/(^PRICE_CLASS_DOMAIN_|_CURRENCY$)/", "", $ctype);
// if one of relation types SETUP, ANNUAL, TRANSFER exists
if (!isset($relations["PRICE_CLASS_DOMAIN_{$tldclass}_SETUP"]) &&
if (
preg_match($dontofferpattern, $tldclass) || (
!isset($relations["PRICE_CLASS_DOMAIN_{$tldclass}_SETUP"]) &&
!isset($relations["PRICE_CLASS_DOMAIN_{$tldclass}_ANNUAL"]) &&
!isset($relations["PRICE_CLASS_DOMAIN_{$tldclass}_TRANSFER"])
!isset($relations["PRICE_CLASS_DOMAIN_{$tldclass}_TRANSFER"]))
) {
continue;
}
//get currency
$currency = $relations[$ctype];
//get tld label; check if tldclass exeption is defined
$tld = isset($tldlib[$tldclass]) ? $tldlib[$tldclass]['tld'] : strtolower($tldclass);
$tld = isset($tldlib[$tldclass]) ? $tldlib[$tldclass] : strtolower($tldclass);
//define pattern
$pattern ="/^PRICE_CLASS_DOMAIN_{$tldclass}_(SETUP|ANNUAL|TRANSFER)$/i";
$types = preg_grep($pattern, $r["PROPERTY"]["RELATIONTYPE"]);
Expand Down
Loading

0 comments on commit cbc8018

Please sign in to comment.