Commit 927830da866 for php.net
commit 927830da8668d58422b3d16645b3dcce160cd233
Author: Niels Dossche <7771979+ndossche@users.noreply.github.com>
Date: Sat Nov 29 05:36:59 2025 -0800
phar: Remove unused min_timestamp field (#20617)
diff --git a/ext/phar/phar.c b/ext/phar/phar.c
index 23624ce6bcc..30c3b371e6b 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 46e45ec61b7..5fc43545453 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;