| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1235,9 +1235,11 @@ protected function validateUrl($attribute, $value) | |||
| 1235 | 1235 | */ | |
| 1236 | 1236 | protected function validateActiveUrl($attribute, $value) | |
| 1237 | 1237 | { | |
| 1238 | - $url = str_replace(['http://', 'https://', 'ftp://'], '', strtolower($value)); | ||
| 1238 | + if ($url = parse_url($value, PHP_URL_HOST)) { | ||
| 1239 | + return count(dns_get_record($url, DNS_A | DNS_AAAA)) > 0; | ||
| 1240 | + } | ||
| 1239 | 1241 | ||
| 1240 | - return checkdnsrr($url, 'A'); | ||
| 1242 | + return false; | ||
| 1241 | 1243 | } | |
| 1242 | 1244 | ||
| 1243 | 1245 | /** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1098,6 +1098,9 @@ public function testValidateActiveUrl() | |||
| 1098 | 1098 | ||
| 1099 | 1099 | $v = new Validator($trans, ['x' => 'http://www.google.com'], ['x' => 'active_url']); | |
| 1100 | 1100 | $this->assertTrue($v->passes()); | |
| 1101 | + | ||
| 1102 | + $v = new Validator($trans, ['x' => 'http://www.google.com/about'], ['x' => 'active_url']); | ||
| 1103 | + $this->assertTrue($v->passes()); | ||
| 1101 | 1104 | } | |
| 1102 | 1105 | ||
| 1103 | 1106 | public function testValidateImage() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments