You are here

function _parser_common_syndication_title in Feeds Atom 7

Same name and namespace in other branches
  1. 6 libraries/atomrdf_parser.inc \_parser_common_syndication_title()

Prepare raw data to be a title

1 call to _parser_common_syndication_title()
atomrdf_parse in libraries/atomrdf_parser.inc
Parse AtomRDF format - for example:

File

libraries/atomrdf_parser.inc, line 518
Contains the atomrd parsing functions.

Code

function _parser_common_syndication_title($title, $body = FALSE) {
  if (empty($title) && !empty($body)) {

    // Explode to words and use the first 3 words.
    $words = preg_split("/[\\s,]+/", strip_tags($body));
    $title = $words[0] . ' ' . $words[1] . ' ' . $words[2];
  }
  return $title;
}