Changeset 60490
- Timestamp:
- 07/21/2025 01:39:41 AM (11 hours ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/SimplePie.php
r59141 r60490 71 71 * SimplePie Version 72 72 */ 73 public const VERSION = '1.8. 0';73 public const VERSION = '1.8.1'; 74 74 75 75 /** … … 1374 1374 $this->sanitize->strip_htmltags($tags); 1375 1375 if ($encode !== null) { 1376 $this->sanitize->encode_instead_of_strip($ tags);1376 $this->sanitize->encode_instead_of_strip($encode); 1377 1377 } 1378 1378 } … … 1757 1757 } 1758 1758 // Check if the cache has been updated 1759 elseif ( isset($this->data['cache_expiration_time']) && $this->data['cache_expiration_time'] >time()) {1759 elseif (!isset($this->data['cache_expiration_time']) || $this->data['cache_expiration_time'] < time()) { 1760 1760 // Want to know if we tried to send last-modified and/or etag headers 1761 1761 // when requesting this file. (Note that it's up to the file to … … 1832 1832 if (!$locate->is_feed($file)) { 1833 1833 $copyStatusCode = $file->status_code; 1834 $copyContentType = $file->headers['content-type'] ;1834 $copyContentType = $file->headers['content-type'] ?? ''; 1835 1835 try { 1836 1836 $microformats = false; -
trunk/tests/phpunit/tests/feed/fetchFeed.php
r59408 r60490 34 34 } 35 35 36 /** 37 * Ensure that fetch_feed() is cached on second and subsequent calls. 38 * 39 * Note: The HTTP request is mocked on the `pre_http_request` filter so 40 * this test doesn't make any HTTP requests so it doesn't need to be 41 * placed in the external-http group. 42 * 43 * @ticket 63717 44 * 45 * @group feed 46 * 47 * @covers ::fetch_feed 48 */ 49 public function test_fetch_feed_cached() { 50 $filter = new MockAction(); 51 add_filter( 'pre_http_request', array( $filter, 'filter' ) ); 52 53 fetch_feed( 'https://wordpress.org/news/feed/' ); 54 $this->assertEquals( 1, $filter->get_call_count(), 'The feed should be fetched on the first call.' ); 55 56 fetch_feed( 'https://wordpress.org/news/feed/' ); 57 $this->assertEquals( 1, $filter->get_call_count(), 'The feed should be cached on the second call. For SP 1.8.x upgrades, backport simplepie/simplepie#830 to resolve.' ); 58 } 59 60 /** 61 * Mock response for `fetch_feed()`. 62 * 63 * This simulates a response from WordPress.org's server for the news feed 64 * to avoid making actual HTTP requests during the tests. 65 * 66 * The method runs on the `pre_http_request` filter, a low level filter 67 * to allow developers to determine whether a request would have been made 68 * under normal circumstances. 69 * 70 * @return array Mocked response data. 71 */ 36 72 public function mocked_rss_response() { 37 73 $single_value_headers = array(
Note: See TracChangeset
for help on using the changeset viewer.