From: Andrew Dolgov Date: Thu, 20 Mar 2008 07:53:00 +0000 (+0100) Subject: remove CDATA sections from article content on import X-Git-Tag: 1.2.21~4 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=621ffb007a5c72259c82745a99285ed47c1096a6;p=tt-rss.git remove CDATA sections from article content on import --- diff --git a/functions.php b/functions.php index 024232e9..958f137d 100644 --- a/functions.php +++ b/functions.php @@ -1038,7 +1038,8 @@ # sanitize content -// $entry_content = sanitize_rss($entry_content); + $entry_content = sanitize_article_content($entry_content); + $entry_title = sanitize_article_content($entry_title); if (defined('DAEMON_EXTENDED_DEBUG') || $_GET['xdebug']) { _debug("update_rss_feed: done collecting data [TITLE:$entry_title]"); @@ -4989,6 +4990,7 @@ print "
"; // print "
"; + print $line["content_preview"]; $e_result = db_query($link, "SELECT * FROM ttrss_enclosures WHERE @@ -5404,4 +5406,10 @@ print ""; } + function sanitize_article_content($text) { + # we don't support CDATA sections in articles, they break our own escaping + $text = preg_replace("/\[\[CDATA/", "", $text); + $text = preg_replace("/\]\]\>/", "", $text); + return $text; + } ?>