diff --git a/lib/ezutils/classes/ezexpiryhandler.php b/lib/ezutils/classes/ezexpiryhandler.php index de30359421c..2c4fb482116 100644 --- a/lib/ezutils/classes/ezexpiryhandler.php +++ b/lib/ezutils/classes/ezexpiryhandler.php @@ -61,6 +61,24 @@ static function fetchData( $path ) */ function store() { + if ( !$this->IsModified ) + { + return; + } + + // EZP-23908: Restore timestamps before saving, to reduce chance of race condition issues + $modifiedTimestamps = $this->Timestamps; + $this->restore(); + + // Apply timestamps that have been added or modified in this process + foreach ( $modifiedTimestamps as $name => $value ) + { + if ( $value > self::getTimestamp( $name, 0 ) ) + { + $this->setTimestamp( $name, $value ); + } + } + if ( $this->IsModified ) { $this->CacheFile->storeContents( "Timestamps, true ) . ";\n?>", 'expirycache', false, true );