Log error if icon not found

This commit is contained in:
Dale Davies
2023-04-18 14:31:39 +01:00
parent 5313089cbb
commit d90ac8eb89

View File

@@ -74,10 +74,15 @@ class Site {
// see if we can get it from Dashboard Icons.
if (pathinfo($this->iconname, PATHINFO_EXTENSION)) {
$file = $this->config->get('sitesdir').'/icons/'.$this->iconname;
$errormessage = 'Icon file not found... '.$file;
} else {
$file = 'https://cdn.jsdelivr.net/gh/walkxcode/dashboard-icons@master/svg/'.$this->iconname.'.svg';
$errormessage = 'Dashboard icon does not exist... '.$this->iconname;
}
$rawimage = @file_get_contents($file);
if (!$rawimage) {
error_log($errormessage);
}
$rawimage = file_get_contents($file);
}
// If we didnt manage to get any icon data from any of the above methods then return
// the default icon.