From 047d7ff45b13be72f73b39be2b54ba0fe20b06bd Mon Sep 17 00:00:00 2001 From: Makar Mikhalchenko <76819996+MakarMS@users.noreply.github.com> Date: Fri, 15 Sep 2023 21:26:56 +0300 Subject: [PATCH] Fixed issue #41 with mixed up parameters in str_contains() function in ToIdn.php (#42) --- src/ToIdn.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ToIdn.php b/src/ToIdn.php index d98e7a1..5640090 100644 --- a/src/ToIdn.php +++ b/src/ToIdn.php @@ -33,10 +33,10 @@ public function convert(string $host): string return $host; } - if (str_contains('/', $host) - || str_contains(':', $host) - || str_contains('?', $host) - || str_contains('@', $host) + if (str_contains($host, '/') + || str_contains($host, ':') + || str_contains($host, '?') + || str_contains($host, '@') ) { throw new InvalidCharacterException('Neither email addresses nor URLs are allowed', 205); }