From 3a5ff45f06422f94e8906d109b1dcbb087d8fb4c Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+ndossche@users.noreply.github.com> Date: Sat, 29 Nov 2025 12:20:53 +0100 Subject: [PATCH] phar: Remove unused min_timestamp field --- ext/phar/phar.c | 10 ++-------- ext/phar/phar_internal.h | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/ext/phar/phar.c b/ext/phar/phar.c index 23624ce6bcc78..30c3b371e6bbd 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -1149,15 +1149,9 @@ static zend_result phar_parse_pharfile(php_stream *fp, char *fname, size_t fname PHAR_GET_32(buffer, entry.uncompressed_filesize); PHAR_GET_32(buffer, entry.timestamp); - if (offset == halt_offset + manifest_len + 4) { - mydata->min_timestamp = entry.timestamp; + if (offset == halt_offset + manifest_len + 4 + || mydata->max_timestamp < entry.timestamp) { mydata->max_timestamp = entry.timestamp; - } else { - if (mydata->min_timestamp > entry.timestamp) { - mydata->min_timestamp = entry.timestamp; - } else if (mydata->max_timestamp < entry.timestamp) { - mydata->max_timestamp = entry.timestamp; - } } PHAR_GET_32(buffer, entry.compressed_filesize); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index 46e45ec61b723..5fc4354545318 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -258,7 +258,6 @@ struct _phar_archive_data { /* hash of mounted directory paths */ HashTable mounted_dirs; uint32_t flags; - uint32_t min_timestamp; uint32_t max_timestamp; int refcount; php_stream *fp;