Update favicon-extension.blade.php

This commit is contained in:
Julian Prieber 2023-11-23 15:18:51 +01:00
parent d169987b72
commit 3609d1477a

View File

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