aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/favicons.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/favicons.php b/lib/favicons.php
index a9ebf9f30..3795dc43e 100644
--- a/lib/favicons.php
+++ b/lib/favicons.php
@@ -132,3 +132,16 @@ function download_favicon(string $url, string $dest): bool {
return ($favicon != '' && file_put_contents($dest, $favicon) > 0) ||
@copy(DEFAULT_FAVICON, $dest);
}
+
+function contentType(string $ico): string {
+ $ico_content_type = 'image/x-icon';
+ if (function_exists('mime_content_type')) {
+ $ico_content_type = mime_content_type($ico) ?: $ico_content_type;
+ }
+ switch ($ico_content_type) {
+ case 'image/svg':
+ $ico_content_type = 'image/svg+xml';
+ break;
+ }
+ return $ico_content_type;
+}