We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e7d1f0 commit d6d36b4Copy full SHA for d6d36b4
app/Network/DNSLookup.php
@@ -4,7 +4,7 @@
4
5
class DNSLookup
6
{
7
- public function getIPs($hostname): array
+ public function getIPs(string $hostname): array
8
9
// IP as host given
10
$ips = filter_var($hostname, FILTER_VALIDATE_IP) ? [$hostname] : [];
app/Rules/RemoteURL.php
@@ -16,6 +16,10 @@ class RemoteURL implements ValidationRule
16
*/
17
public function validate(string $attribute, mixed $value, Closure $fail): void
18
19
+ if (!is_string($value)) {
20
+ $fail("Invalid URL: URL must be a string.");
21
+ }
22
+
23
$host = parse_url($value, PHP_URL_HOST);
24
$ips = App::make(DNSLookup::class)->getIPs($host);
25
0 commit comments