From c7fe1b4e9e392e0b9ffa55151c43ea7e2e2ee709 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 28 Oct 2012 12:44:10 +0400 Subject: sanitize article content when importing data from feed --- include/functions.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'include/functions.php') diff --git a/include/functions.php b/include/functions.php index f607cb3cc..a8f42d6d5 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2686,11 +2686,15 @@ } - function sanitize($link, $str, $force_strip_tags = false, $owner = false, $site_url = false) { + function sanitize($link, $str, $owner = false, $site_url = false) { if (!$owner) $owner = $_SESSION["uid"]; $res = trim($str); if (!$res) return ''; + # we don't support CDATA sections in articles, they break our own escaping + $res = preg_replace("/\[\[CDATA/", "", $res); + $res = preg_replace("/\]\]\>/", "", $res); + $config = array('safe' => 1, 'deny_attribute' => 'style'); $res = htmLawed($res, $config); @@ -3626,13 +3630,6 @@ } } // function encrypt_password - 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; - } - function load_filters($link, $feed_id, $owner_uid, $action_id = false) { $filters = array(); -- cgit v1.2.3