Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9205
Modified Files:
serendipity_rss_exchange.inc.php
Log Message:
fix charset trouble; the date inside the DB should always be native,
since we don'T enforce UTF8 anywhere.
Index: serendipity_rss_exchange.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- serendipity_rss_exchange.inc.php 6 Oct 2004 13:01:42 -0000 1.10
+++ serendipity_rss_exchange.inc.php 7 Oct 2004 10:34:27 -0000 1.11
@@ -10,7 +10,7 @@
$bodyonly = (isset($serendipity['POST']['bodyonly']) && $serendipity['POST']['bodyonly'] == 'true' ? true : false);
if ($item['description']) {
- $entry['body'] = $item['description'];
+ $entry['body'] = utf8_decode($item['description']);
}
if ($item['content:encoded']) {
@@ -26,14 +26,14 @@
// 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'];;
+ $data .= utf8_decode($item['content:encoded']);
} else {
- $data = $item['content:encoded'];
+ $data = utf8_decode($item['content:encoded']);
}
}
- $entry['title'] = $item['title'];
- $entry['timestamp'] = strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date']);
+ $entry['title'] = utf8_decode($item['title']);
+ $entry['timestamp'] = utf8_decode(strtotime(isset($item['pubdate']) ? $item['pubdate'] : $item['dc:date']));
if ($entry['timestamp'] == -1) {
$entry['timestamp'] = time();
}
@@ -45,7 +45,7 @@
}
if (!empty($item['category'])) {
- $cat = serendipity_fetchCategoryInfo(0, trim($item['category']));
+ $cat = serendipity_fetchCategoryInfo(0, trim(utf8_decode($item['category'])));
if (is_array($cat) && isset($cat['categoryid'])) {
$entry['categories'][] = $cat['categoryid'];
}
|