Permalink
Browse files

Moved function from blog/lib to rsslib. unhtmlentities is required to…

… liberate some rss feed information from the clutches of encoding.
  • Loading branch information...
1 parent 319f73c commit 0bae4f8c0f8892924b6902d695267e1a1ecc2616 dhawes committed Jan 27, 2005
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/rsslib.php
View
@@ -445,4 +445,16 @@ function rss_get_form($act, $url, $rssid, $printnow=true) {
}
return $returnstring;
}
-?>
+
+/**
+ * translates HTML special characters back to ASCII
+ * RSS feeds may have encoded html commands which we want to translate properly
+ * to display as intended rather than as source (html script visible in feed)
+ * This function taken from Simplog - www.simplog.net
+ */
+function rss_unhtmlentities($string) {
+ $trans_tbl = get_html_translation_table (HTML_ENTITIES);
+ $trans_tbl = array_flip ($trans_tbl);
+ return strtr ($string, $trans_tbl);
+}
+?>

0 comments on commit 0bae4f8

Please sign in to comment.