Skip to content
Snippets Groups Projects
Commit 87fd644e authored by git's avatar git Committed by Chris Leppanen
Browse files

Issue #1420360 by anarchocoder: Fixed Common Syndication Parser sometimes...

Issue #1420360 by anarchocoder: Fixed Common Syndication Parser sometimes creates php warning when feed item title is empty.
parent 3bd73430
No related branches found
No related tags found
No related merge requests found
...@@ -583,8 +583,8 @@ function _parser_common_syndication_link($links) { ...@@ -583,8 +583,8 @@ function _parser_common_syndication_link($links) {
function _parser_common_syndication_title($title, $body = FALSE) { function _parser_common_syndication_title($title, $body = FALSE) {
if (empty($title) && !empty($body)) { if (empty($title) && !empty($body)) {
// Explode to words and use the first 3 words. // Explode to words and use the first 3 words.
$words = preg_split("/[\s,]+/", strip_tags($body)); $words = preg_split('/[\s,]+/', strip_tags($body));
$title = $words[0] . ' ' . $words[1] . ' ' . $words[2]; $title = implode(' ', array_slice($words, 0, 3));
} }
return $title; return $title;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment