Skip to content
Snippets Groups Projects
Commit 9f274346 authored by Igor Biki's avatar Igor Biki
Browse files

Merge branch 'feature/ISTWCMS-5804-ebremner-site-logo-fixes' into '1.0.x'

Feature/istwcms 5804 ebremner site logo fixes

See merge request !271
parents 85bd8cda 369d6ad6
No related branches found
No related tags found
1 merge request!271Feature/istwcms 5804 ebremner site logo fixes
...@@ -594,4 +594,20 @@ class UWService implements UWServiceInterface { ...@@ -594,4 +594,20 @@ class UWService implements UWServiceInterface {
return $list; return $list;
} }
/**
* {@inheritDoc}
*/
public function validExternalUrl(string $url): bool {
// Get the headers of the URL.
$headers = @get_headers($url);
// Use condition to check if there is no URL.
if ($headers && strpos($headers[0], '404')) {
return FALSE;
}
return TRUE;
}
} }
...@@ -211,4 +211,15 @@ interface UWServiceInterface { ...@@ -211,4 +211,15 @@ interface UWServiceInterface {
*/ */
public function getContentTypeUsage(array $content_types, bool $show_null_content_types): array; public function getContentTypeUsage(array $content_types, bool $show_null_content_types): array;
/**
* Function to check if an external url is valid.
*
* @param string $url
* The URL to be checked.
*
* @return bool
* Whether url is valid or not.
*/
public function validExternalUrl(string $url): bool;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment