Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2113

Order: Domain availability checks may use incorrect TLD to determine pricing

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-b1
    • Component/s: Plugins
    • Labels:
      None

      Description

      When checking a domain's availability, if multiple TLDs are selected and they are subsets of one another (e.g. ".co" and ".com.co"), then it is possible for the pricing for both results to use only the pricing from the ".co" package. In this case, the pricing for ".com.co" is incorrect.

      This issue is due to the order in which the appropriate packages are determined from the package group for the set of TLDs.

      To resolve the issue, sort the TLDs such that longer TLDs (e.g. ".com.co") are evaluated before shorter subset TLDs (e.g. ".co").

      Update /order/lib/order_types/domain/order_type_domain.php.
      in ::getTlds()
      Replace:

      ksort($tlds);
      

      with:

      array_multisort(
           array_map(
               function($tld) {
                  return strlen($tld);
               },
               array_keys($tlds)
           ),
           SORT_DESC,
           $tlds,
           array_keys($tlds),
           SORT_ASC
      );
      

      This will sort the TLDs by length, then order them A-Z,
      e.g.
      .com.net
      .com.co
      .co.uk
      .biz
      .com
      .net
      .co
      .uk

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            tyson Tyson Phillips (Inactive)
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              15/Sep/16