summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-05-20 02:53:11 +0100
committerAndrew Dolgov <[email protected]>2007-05-20 02:53:11 +0100
commit0c3d1c68bcefadb44e072d4b47ea3d76a4b2161c (patch)
tree4729823c195fa5fa76989f8dcbaba2dcc42abfd8 /functions.php
parent2d3f116c60aab7b9e33829a6a01b4574ca557dd2 (diff)
store tags as category elements in syndicated feed, improve tag sanitizing
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/functions.php b/functions.php
index c8873a051..6df61bd42 100644
--- a/functions.php
+++ b/functions.php
@@ -2619,7 +2619,13 @@
print "<item>";
print "<id>" . htmlspecialchars($line["guid"]) . "</id>";
print "<link>" . htmlspecialchars($line["link"]) . "</link>";
-
+
+ $tags = get_article_tags($link, $line["id"]);
+
+ foreach ($tags as $tag) {
+ print "<category>" . htmlspecialchars($tag) . "</category>";
+ }
+
$rfc822_date = date('r', strtotime($line["updated"]));
print "<pubDate>$rfc822_date</pubDate>";
@@ -2627,8 +2633,8 @@
print "<title>" .
htmlspecialchars($line["title"]) . "</title>";
- print "<description>" .
- htmlspecialchars($line["content_preview"]) . "</description>";
+ print "<description><![CDATA[" .
+ $line["content_preview"] . "]]></description>";
print "</item>";
}
@@ -3352,9 +3358,10 @@
$a_id = db_escape_string($id);
- $tmp_result = db_query($link, "SELECT DISTINCT tag_name FROM
+ $tmp_result = db_query($link, "SELECT DISTINCT tag_name,
+ owner_uid as owner FROM
ttrss_tags WHERE post_int_id = (SELECT int_id FROM ttrss_user_entries WHERE
- ref_id = '$a_id' AND owner_uid = '".$_SESSION["uid"]."' LIMIT 1) ORDER BY tag_name");
+ ref_id = '$a_id' AND owner_uid = owner LIMIT 1) ORDER BY tag_name");
$tags = array();
@@ -3986,9 +3993,10 @@
$tag = mb_strtolower($tag, 'utf-8');
- $tag = str_replace('\"', "", $tag);
- $tag = str_replace('"', "", $tag);
- $tag = str_replace("+", " ", $tag);
+ $tag = preg_replace('/[\"\+\>\<]/', "", $tag);
+
+// $tag = str_replace('"', "", $tag);
+// $tag = str_replace("+", " ", $tag);
$tag = str_replace("technorati tag: ", "", $tag);
return $tag;