]> git.mjollnir.org Git - moodle.git/commitdiff
Moved function from blog/lib to rsslib. unhtmlentities is required to liberate some...
authordhawes <dhawes>
Thu, 27 Jan 2005 01:24:33 +0000 (01:24 +0000)
committerdhawes <dhawes>
Thu, 27 Jan 2005 01:24:33 +0000 (01:24 +0000)
lib/rsslib.php

index a45ed58e46e6d3177a1a1f74c9b8e84b01dd6258..0ba259d4aa3e4dcecad468ff2dcf58b9299b2efc 100644 (file)
@@ -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);
+}
+?>
\ No newline at end of file