MDL-75889 core: compare domain names in a case-insensitive manner.

As per https://www.rfc-editor.org/rfc/rfc1035#section-3.1
This commit is contained in:
Paul Holden
2022-11-07 22:37:00 +00:00
parent 71841556aa
commit 8a1c8f8bb3
3 changed files with 15 additions and 6 deletions
+4 -1
View File
@@ -14,13 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core;
/**
* This tests the static helper functions contained in the class '\core\ip_utils'.
*
* @package core
* @covers \core\ip_utils
* @copyright 2016 Jake Dallimore <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -355,6 +355,7 @@ class ip_utils_test extends \basic_testcase {
public function data_domain_addresses() {
return [
[true, 'example.com'],
[true, 'ExAmPle.com'],
[false, 'sub.example.com'],
[false, 'example.com.au'],
[false, ' example.com'], // A space at the front of the domain is invalid.
@@ -362,6 +363,8 @@ class ip_utils_test extends \basic_testcase {
[false, 'test.example.com'],
[false, 'moodle.com'],
[true, 'test.moodle.com'],
[true, 'TeSt.moodle.com'],
[true, 'test.MoOdLe.com'],
[false, 'test.moodle.com.au'],
[true, 'nice.address.per.this.penny-arcade.com'],
[false, 'normal.per.this.penny-arcade.com.au'],