You are here

function date_ical_parse_text in Date 7.2

Same name and namespace in other branches
  1. 5.2 date_api_ical.inc \date_ical_parse_text()
  2. 5 date_api_ical.inc \date_ical_parse_text()
  3. 6.2 date_api_ical.inc \date_ical_parse_text()
  4. 6 date_api_ical.inc \date_ical_parse_text()
  5. 7.3 date_api/date_api_ical.inc \date_ical_parse_text()
  6. 7 date_api/date_api_ical.inc \date_ical_parse_text()

Parse and clean up ical text elements.

1 call to date_ical_parse_text()
date_ical_parse in date_api/date_api_ical.inc
Returns an array of iCalendar information from an iCalendar file.

File

date_api/date_api_ical.inc, line 558
Parse iCal data.

Code

function date_ical_parse_text($field, $data) {
  if (strstr($field, 'QUOTED-PRINTABLE')) {
    $data = quoted_printable_decode($data);
  }

  // Strip line breaks within element.
  $data = str_replace(array(
    "\r\n ",
    "\n ",
    "\r ",
  ), '', $data);

  // Put in line breaks where encoded.
  $data = str_replace(array(
    "\\n",
    "\\N",
  ), "\n", $data);

  // Remove other escaping.
  $data = stripslashes($data);
  return $data;
}