diff --git a/core/modules/aggregator/aggregator.processor.inc b/core/modules/aggregator/aggregator.processor.inc index c12c90fca6b2c4a3d2b80d87f05344037e67c689..b333a963bf559bba552a40378e8e0e2eec5e0c04 100644 --- a/core/modules/aggregator/aggregator.processor.inc +++ b/core/modules/aggregator/aggregator.processor.inc @@ -38,8 +38,9 @@ function aggregator_aggregator_process($feed) { $item['timestamp'] = isset($entry->timestamp) ? $entry->timestamp : REQUEST_TIME; } - // Make sure the item title fits in 255 varchar column. + // Make sure the item title and author fit in the 255 varchar column. $item['title'] = truncate_utf8($item['title'], 255, TRUE, TRUE); + $item['author'] = truncate_utf8($item['author'], 255, TRUE, TRUE); aggregator_save_item(array('iid' => (isset($entry->iid) ? $entry->iid : ''), 'fid' => $feed->fid, 'timestamp' => $item['timestamp'], 'title' => $item['title'], 'link' => $item['link'], 'author' => $item['author'], 'description' => $item['description'], 'guid' => $item['guid'])); } } diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php index 9bd57e914740b88632b89d91a494ef351d7c81a9..907bc3a1326e394e453c02da263272e1e8984102 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/FeedParserTest.php @@ -38,6 +38,15 @@ function testRSS091Sample() { $this->assertText('First example feed item title'); $this->assertLinkByHref('http://example.com/example-turns-one'); $this->assertText('First example feed item description.'); + + // Several additional items that include elements over 255 characters. + $this->assertRaw("Second example feed item title."); + $this->assertText('Long link feed item title'); + $this->assertText('Long link feed item description'); + $this->assertLinkByHref('http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing'); + $this->assertText('Long author feed item title'); + $this->assertText('Long author feed item description'); + $this->assertLinkByHref('http://example.com/long/author'); } /** diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php index c35345f732d3bc80fb6d5da28158199dcf4b8f0b..32433ae2fbe02d6c0121e5e9d683a86ac1c66606 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Tests/RemoveFeedItemTest.php @@ -36,9 +36,9 @@ function testRemoveFeedItem() { // Update and remove items two times in a row to make sure that removal // resets all 'modified' information (modified, etag, hash) and allows for // immediate update. - $this->updateAndRemove($feed, 2); - $this->updateAndRemove($feed, 2); - $this->updateAndRemove($feed, 2); + $this->updateAndRemove($feed, 4); + $this->updateAndRemove($feed, 4); + $this->updateAndRemove($feed, 4); // Delete feed. $this->deleteFeed($feed); } diff --git a/core/modules/aggregator/tests/aggregator_test_rss091.xml b/core/modules/aggregator/tests/aggregator_test_rss091.xml index f39a2732c03459b79be2b51ca4f6b1f4dc117be7..29440227fcf22fda378b9fa1c5c85065cabd7448 100644 --- a/core/modules/aggregator/tests/aggregator_test_rss091.xml +++ b/core/modules/aggregator/tests/aggregator_test_rss091.xml @@ -26,5 +26,16 @@ <link>http://example.com/example-turns-two</link> <description>Second example feed item description.</description> </item> + <item> + <title>Long link feed item title.</title> + <link>http://example.com/tomorrow/and/tomorrow/and/tomorrow/creeps/in/this/petty/pace/from/day/to/day/to/the/last/syllable/of/recorded/time/and/all/our/yesterdays/have/lighted/fools/the/way/to/dusty/death/out/out/brief/candle/life/is/but/a/walking/shadow/a/poor/player/that/struts/and/frets/his/hour/upon/the/stage/and/is/heard/no/more/it/is/a/tale/told/by/an/idiot/full/of/sound/and/fury/signifying/nothing</link> + <description>Long link feed item description.</description> + </item> + <item> + <title>Long author feed item title.</title> + <link>http://example.com/long/author</link> + <author>I wanted to get out and walk eastward toward the park through the soft twilight, but each time I tried to go I became entangled in some wild, strident argument which pulled me back, as if with ropes, into my chair. Yet high over the city our line of yellow windows must have contributed their share of human secrecy to the casual watcher in the darkening streets, and I was him too, looking up and wondering. I was within and without, simultaneously enchanted and repelled by the inexhaustible variety of life.</author> + <description>Long author feed item description.</description> + </item> </channel> </rss>