File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,17 @@ function URL_check(string $url): string {
48
48
)
49
49
);
50
50
51
+ // Verify the URL is valid
52
+ if (!filter_var ($ url , FILTER_VALIDATE_URL )) {
53
+ return '<span class="glyph-offline" data-bs-toggle="tooltip" data-bs-title="invalid-url"><i class="fas fa-circle-xmark"></i></span> ' ;
54
+ }
55
+
51
56
// Get the headers and 3-digit status code
52
57
$ headers = get_headers ($ url );
53
58
54
59
// If headers are false or the array is empty
55
- if ($ headers === false || !isset ($ headers [0 ])) {
60
+ $ headers = @get_headers ($ url );
61
+ if (!$ headers || !isset ($ headers [0 ])) {
56
62
return '<span class="glyph-offline" data-bs-toggle="tooltip" data-bs-title="php-error"><i class="fas fa-circle-xmark"></i></span> ' ;
57
63
}
58
64
You can’t perform that action at this time.
0 commit comments