Update favicon-extension.blade.php

This commit is contained in:
Julian Prieber 2023-11-23 15:18:51 +01:00
parent d169987b72
commit 3609d1477a
1 changed files with 13 additions and 9 deletions

View File

@ -1,14 +1,18 @@
<?php <?php
function localIcon($id) { if (!function_exists('localIcon')) {
function localIcon($id)
{
$directory = base_path("assets/favicon/icons"); $directory = base_path("assets/favicon/icons");
$files = scandir($directory); $files = scandir($directory);
$pathinfo = "error.error"; $pathinfo = "error.error";
foreach ($files as $file) { foreach ($files as $file) {
if (strpos($file, $id . '.') !== false) { if (strpos($file, $id . '.') !== false) {
$pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION); $pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION);
}} }
}
return $pathinfo; return $pathinfo;
} }
}
?> ?>