Welcome to Geeklog Wednesday, December 01 2021 @ 10:45 pm EST

Geeklog Forums

Bug in lib-syndication for plain old text posts


Ian

Anonymous
I noticed that the rss feeds from geeklog were not converting new lines to <br> when creating the rss feed. I have created a patch to lib-syndication to fix the issue

lib-syndication.php.ian is the original file before the modifications.

--- lib-syndication.php.ian 2006-11-30 15:24:47.000000000 -0500
+++ lib-syndication.php 2007-12-09 20:22:51.000000000 -0500
@@ -266,7 +266,14 @@

$fulltext = trim( $fulltext );
$fulltext = preg_replace( "/(\015)/", "", $fulltext );
-
+ if( $row['postmode'] == 'plaintext' ) {
+ if( !empty( $storytext )) {
+ $storytext = nl2br( $storytext );
+ }
+ if( !empty( $fulltext )) {
+ $fulltext = nl2br( $fulltest );
+ }
+ }
$storylink = COM_buildUrl( $_CONF['site_url']
. '/article.php?story=' . $row['sid'] );
$extensionTags = PLG_getFeedElementExtensions('article', $row['sid'], $feedType, $feedVe
rsion, $tid, $fid);
@@ -373,6 +380,14 @@
$storytext = SYND_truncateSummary( $fulltext, $contentLength );
$fulltext = trim( $fulltext );
$fulltext = preg_replace( "/(\015)/", "", $fulltext );
+ if ( $row['postmode'] == 'plaintext' ) {
+ if( !empty( $storytext )) {
+ $storytext = nl2br( $storytext );
+ }
+ if( !empty( $fulltext )) {
+ $fulltext = nl2br( $fulltest );
+ }
+ }

$storylink = COM_buildUrl( $_CONF['site_url'] . '/article.php?story='
. $row['sid'] );
 Quote

All times are EST. The time is now 10:45 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content