From 88a08b7ec9b8e9ffa9dd6b2a3a7901bdd0799fbd Mon Sep 17 00:00:00 2001 From: gtbu Date: Tue, 10 Dec 2024 12:49:44 +0100 Subject: [PATCH] update tool.php removed @ -code --- composer.json | 18 ------------------ include/tool.php | 6 ++++-- phpunit/phpunit.log | 0 3 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 composer.json delete mode 100644 phpunit/phpunit.log diff --git a/composer.json b/composer.json deleted file mode 100644 index 82dd246..0000000 --- a/composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "typesetter/typesetter", - "type": "project", - "description":"Open source CMS written in PHP focused on ease of use with true WYSIWYG editing and flat-file storage.", - "hoempage":"http://www.typesettercms.com/", - "require": {}, - "require-dev": { - "phpcompatibility/php-compatibility": "^9.3", - "symfony/process": "<4", - "guzzlehttp/guzzle": "^6.5", - "phpunit/php-code-coverage": "<7", - "phpunit/phpunit": "<8 >=4" - }, - "scripts": { - "post-install-cmd": "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility", - "post-update-cmd" : "\"vendor/bin/phpcs\" --config-set installed_paths vendor/phpcompatibility/php-compatibility" - } -} diff --git a/include/tool.php b/include/tool.php index a7115e1..a1c3045 100644 --- a/include/tool.php +++ b/include/tool.php @@ -118,8 +118,10 @@ namespace gp{ $modified = 0; $content_length = 0; foreach($files as $file){ - $content_length += @filesize($file); - $modified = max($modified, @filemtime($file)); + if (file_exists($file)) { + $content_length += filesize($file);} + if (file_exists($file) && is_readable($file)) { + $modified = max($modified, filemtime($file));} } return self::GenEtag($modified, $content_length); diff --git a/phpunit/phpunit.log b/phpunit/phpunit.log deleted file mode 100644 index e69de29..0000000