Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22198
Modified Files:
Tag: branch-smarty
serendipity_rss_exchange.inc.php
Log Message:
fix substring logic to adapt to wordpress adding a '...' to the entries body.
Index: serendipity_rss_exchange.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -u -d -r1.5.2.1 -r1.5.2.2
--- serendipity_rss_exchange.inc.php 27 Sep 2004 10:13:39 -0000 1.5.2.1
+++ serendipity_rss_exchange.inc.php 27 Sep 2004 10:42:52 -0000 1.5.2.2
@@ -23,8 +23,9 @@
// See if the 'description' element is a substring of the 'content:encoded' part. If it is,
// we will only fetch the full 'content:encoded' part. If it's not a substring, we append
// the 'content:encoded' part to either body or extended entry (respecting the 'bodyonly'
- // switch).
- if ($entry['body'] != substr($item['content:encoded'], 0, strlen($entry['body']))) {
+ // switch). We substract 4 letters because of possible '...' additions to an entry.
+ $testbody = substr(trim(strip_tags($entry['body'])), 0, -4);
+ if ($testbody != substr(trim(strip_tags($item['content:encoded'])), 0, strlen($testbody))) {
$data .= $item['content:encoded'];;
} else {
$data = $item['content:encoded'];
|