Fix Lines not delimited by CRLF sequence near line # 1 error
This commit is contained in:
@@ -32,21 +32,21 @@ $url = add_query_arg( 'feed', 'sp-ical', get_post_permalink( $post ) );
|
|||||||
$url = wordwrap( $url , 60, "\n\t", true );
|
$url = wordwrap( $url , 60, "\n\t", true );
|
||||||
|
|
||||||
$output =
|
$output =
|
||||||
"BEGIN:VCALENDAR\n" .
|
"BEGIN:VCALENDAR\r\n" .
|
||||||
"VERSION:2.0\n" .
|
"VERSION:2.0\r\n" .
|
||||||
"PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\n" .
|
"PRODID:-//ThemeBoy//SportsPress//" . strtoupper( $locale ) . "\r\n" .
|
||||||
"CALSCALE:GREGORIAN\n" .
|
"CALSCALE:GREGORIAN\r\n" .
|
||||||
"METHOD:PUBLISH\n" .
|
"METHOD:PUBLISH\r\n" .
|
||||||
"URL:" . $url . "\n" .
|
"URL:" . $url . "\r\n" .
|
||||||
"X-FROM-URL:" . $url . "\n" .
|
"X-FROM-URL:" . $url . "\r\n" .
|
||||||
"NAME:" . $post->post_title . "\n" .
|
"NAME:" . $post->post_title . "\r\n" .
|
||||||
"X-WR-CALNAME:" . $post->post_title . "\n" .
|
"X-WR-CALNAME:" . $post->post_title . "\r\n" .
|
||||||
"DESCRIPTION:" . $post->post_title . "\n" .
|
"DESCRIPTION:" . $post->post_title . "\r\n" .
|
||||||
"X-WR-CALDESC:" . $post->post_title . "\n" .
|
"X-WR-CALDESC:" . $post->post_title . "\r\n" .
|
||||||
"REFRESH-INTERVAL;VALUE=DURATION:PT2M\n" .
|
"REFRESH-INTERVAL;VALUE=DURATION:PT2M\r\n" .
|
||||||
"X-PUBLISHED-TTL:PT2M\n" .
|
"X-PUBLISHED-TTL:PT2M\r\n" .
|
||||||
"TZID:" . $timezone . "\n" .
|
"TZID:" . $timezone . "\r\n" .
|
||||||
"X-WR-TIMEZONE:" . $timezone . "\n";
|
"X-WR-TIMEZONE:" . $timezone . "\r\n";
|
||||||
|
|
||||||
// Loop through each event
|
// Loop through each event
|
||||||
foreach ( $events as $event):
|
foreach ( $events as $event):
|
||||||
@@ -96,7 +96,7 @@ foreach ( $events as $event):
|
|||||||
$geo = false;
|
$geo = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$location = wordwrap( $location , 60, "\n\t" );
|
$location = wordwrap( $location , 60, "\r\n\t" );
|
||||||
|
|
||||||
// Get title or write summary based on scores
|
// Get title or write summary based on scores
|
||||||
$results = array();
|
$results = array();
|
||||||
@@ -137,28 +137,28 @@ foreach ( $events as $event):
|
|||||||
|
|
||||||
// Append to output string
|
// Append to output string
|
||||||
$output .=
|
$output .=
|
||||||
"BEGIN:VEVENT\n" .
|
"BEGIN:VEVENT\r\n" .
|
||||||
"SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\n" .
|
"SUMMARY:" . preg_replace('/([\,;])/','\\\$1', $summary) . "\r\n" .
|
||||||
"UID:$event->ID\n" .
|
"UID:$event->ID\r\n" .
|
||||||
"STATUS:CONFIRMED\n" .
|
"STATUS:CONFIRMED\r\n" .
|
||||||
"DTSTAMP:19700101T000000\n".
|
"DTSTAMP:19700101T000000\r\n".
|
||||||
"DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\n" .
|
"DTSTART:" . mysql2date( $date_format, $event->post_date ) . "\r\n" .
|
||||||
"DTEND:" . $end->format( $date_format ) . "\n" .
|
"DTEND:" . $end->format( $date_format ) . "\r\n" .
|
||||||
"LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\n";
|
"LAST-MODIFIED:" . mysql2date( $date_format, $event->post_modified_gmt ) . "\r\n";
|
||||||
|
|
||||||
if ( $description ) {
|
if ( $description ) {
|
||||||
$output .= "DESCRIPTION:" . $description . "\n";
|
$output .= "DESCRIPTION:" . $description . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $location ) {
|
if ( $location ) {
|
||||||
$output .= "LOCATION:" . $location . "\n";
|
$output .= "LOCATION:" . $location . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $geo ) {
|
if ( $geo ) {
|
||||||
$output .= "GEO:" . $geo . "\n";
|
$output .= "GEO:" . $geo . "\r\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= "END:VEVENT\n";
|
$output .= "END:VEVENT\r\n";
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
// End output
|
// End output
|
||||||
|
|||||||
Reference in New Issue
Block a user