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

Fixed Check Availability error #5

Closed
wants to merge 1 commit into from
Closed

Fixed Check Availability error #5

wants to merge 1 commit into from

Conversation

Mr-DRP
Copy link

@Mr-DRP Mr-DRP commented May 12, 2020

The domain search was returning unavailable with all domains. The domain comparision check done inside checkAvailability function was making error so fixed it with simple replacement according to the response received from API.

@nahanil
Copy link

nahanil commented May 12, 2020

@Mr-DRP what version of PHP were you running when the availability check failed? I can reproduce it in PHP 7.3.17 but not PHP 7.0.33.

Both Blesta installs are running 4.9.1 and the master branch of this repository.

In both cases below I dumped the XML response in apis/namesilo_api.php#125 before it's parsed and returned, and then again in namesilo.php#2199 after it's been parsed.

PHP 7.0

<?xml version="1.0"?>
<namesilo><request><operation>checkRegisterAvailability</operation><ip>1.1.1.1</ip></request><reply><code>300</code><detail>success</detail><available><domain price="11.79" premium="0">nononononodneodneond.net</domain></available></reply></namesilo>
stdClass Object
(
    [code] => 300
    [detail] => success
    [available] => stdClass Object
        (
            [domain] => nononononodneodneond.net
        )

)

PHP 7.3

<?xml version="1.0"?>
<namesilo><request><operation>checkRegisterAvailability</operation><ip>1.1.1.1</ip></request><reply><code>300</code><detail>success</detail><available><domain price="8.99" premium="0">noodledoodlesnoot.com</domain></available></reply></namesilo>
stdClass Object
(
    [code] => 300
    [detail] => success
    [available] => stdClass Object
        (
            [domain] => stdClass Object
                (
                    [@attributes] => stdClass Object
                        (
                            [price] => 8.99
                            [premium] => 0
                        )
                    [0] => noodledoodlesnoot.com
                )
        )
)

Edit Seems specific to PHP >= 7.3.17 / 7.4.5 https://3v4l.org/AKM2X

@Mr-DRP
Copy link
Author

Mr-DRP commented May 13, 2020

I am using 7.3.17. Yes your are right i tried with other version and it worked. So, the change is response might affect others features too. Not only the domain availability check.

@Mr-DRP Mr-DRP closed this May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants