From 9592365573ec2190b6167ad51bd9a65bbb284f74 Mon Sep 17 00:00:00 2001 From: Doug Bird Date: Wed, 13 Dec 2017 23:07:52 -0800 Subject: [PATCH] fixes to use lcase --- examples/js-demo.js | 4 ++-- examples/php-demo.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/js-demo.js b/examples/js-demo.js index 4ff7642..45224bb 100644 --- a/examples/js-demo.js +++ b/examples/js-demo.js @@ -7,7 +7,7 @@ let tldCheck; tldCheck = "com"; console.log("Is '" + tldCheck + "' a real TLD?"); -if (tldEnum.tldList.indexOf(tldCheck) != -1) { +if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) { console.log(" yes"); } else { console.log(" no"); @@ -15,7 +15,7 @@ if (tldEnum.tldList.indexOf(tldCheck) != -1) { tldCheck = "somethingWeird"; console.log("Is '" + tldCheck + "' a real TLD?"); -if (tldEnum.tldList.indexOf(tldCheck) != -1) { +if (tldEnum.tldList.indexOf(tldCheck.toLowerCase()) != -1) { console.log(" yes"); } else { console.log(" no"); diff --git a/examples/php-demo.php b/examples/php-demo.php index 8f4f765..85cf6e0 100644 --- a/examples/php-demo.php +++ b/examples/php-demo.php @@ -8,7 +8,7 @@ echo "There are " . count(TldEnum::TLD_ENUM) . " IANA TLDs\n"; $tldCheck = "com"; echo "Is '$tldCheck' a real TLD?\n"; -if (in_array($tldCheck, TldEnum::TLD_ENUM)) { +if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) { echo " yes\n"; } else { echo " no\n"; @@ -16,7 +16,7 @@ if (in_array($tldCheck, TldEnum::TLD_ENUM)) { $tldCheck = "somethingWeird"; echo "Is '$tldCheck' a real TLD?\n"; -if (in_array($tldCheck, TldEnum::TLD_ENUM)) { +if (in_array(strtolower($tldCheck), TldEnum::TLD_ENUM)) { echo " yes\n"; } else { echo " no\n";