Skip to content

Commit

Permalink
Merge pull request #31 from FreshRSS/upstream-sync
Browse files Browse the repository at this point in the history
Upstream sync simplepie#883
  • Loading branch information
Alkarex authored Sep 29, 2024
2 parents 530afaf + d316210 commit 88f13f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SimplePie.php
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ protected function fetch_data(&$cache)
$this->data = [];
}
// Check if the cache has been updated
elseif (empty($this->data['cache_expiration_time']) || $this->data['cache_expiration_time'] < time()) { // FreshRSS https://github.com/simplepie/simplepie/pull/846
elseif (!isset($this->data['cache_expiration_time']) || $this->data['cache_expiration_time'] < time()) {
// Want to know if we tried to send last-modified and/or etag headers
// when requesting this file. (Note that it's up to the file to
// support this, but we don't always send the headers either.)
Expand Down
6 changes: 3 additions & 3 deletions tests/Integration/CachingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testInitWithDifferentCacheStateCallsCacheCorrectly(
*/
public static function provideSavedCacheData(): array
{
$defaultMtime = time() - 1; // FreshRSS: -1 to account for tests running in the same second
$defaultMtime = time() - 1; // -1 to account for tests running within the same second
$defaultExpirationTime = $defaultMtime + 3600;

$expectDefaultDataWritten = [
Expand Down Expand Up @@ -256,10 +256,10 @@ public static function provideSavedCacheData(): array
[CacheInterface::class, $currentlyCachedDataWithNonFeedUrl, $expectDataWithNewFeedUrl, $defaultMtime],
// Check if the cache has been updated
[Base::class, $currentlyCachedDataIsUpdated, $expectDefaultDataWritten, $defaultMtime],
[CacheInterface::class, $currentlyCachedDataIsUpdated, $expectNoDataWritten, $defaultMtime], // FreshRSS https://github.com/simplepie/simplepie/pull/846
[CacheInterface::class, $currentlyCachedDataIsUpdated, $expectNoDataWritten, $defaultMtime],
// If the cache is still valid, just return true
[Base::class, $currentlyCachedDataIsValid, $expectDefaultDataWritten, $defaultMtime],
[CacheInterface::class, $currentlyCachedDataIsValid, $expectDefaultDataWritten, $defaultMtime], // FreshRSS https://github.com/simplepie/simplepie/pull/846
[CacheInterface::class, $currentlyCachedDataIsValid, $expectDefaultDataWritten, $defaultMtime],
];
}
}

0 comments on commit 88f13f2

Please sign in to comment.