From 7354e62eaf207c2a3031f591f52f5727710a28ae Mon Sep 17 00:00:00 2001
From: Maja Wolniewicz <mgw@umk.pl>
Date: Thu, 29 Feb 2024 13:04:09 +0100
Subject: [PATCH] fixed logo handling

---
 web/validator-check-logos.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/web/validator-check-logos.php b/web/validator-check-logos.php
index 89c2c13..0300b54 100644
--- a/web/validator-check-logos.php
+++ b/web/validator-check-logos.php
@@ -67,7 +67,12 @@ foreach ($_POST as $k=>$v) {
          fclose($fp);
          if ($suffix == 'svg') {
            $f = fopen($fileName, 'r');
-           $imageData = fread($f, filesize($fileName));
+           if ($f && filesize($fileName) > 0) {
+             $imageData = fread($f, filesize($fileName));
+           } else {
+             $imageData = "";
+             $result[] =  'ERROR: Could not download logo';
+           }
          }
        } else {
          $fileName = '/tmp/testlogo'.bin2hex(openssl_random_pseudo_bytes(10));
-- 
GitLab