From 5be008366b46848eb4e2a150ab038fe1f1a3f812 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 17 Nov 2009 20:06:28 +0300 Subject: [PATCH 1/3] do not redeclare internal php functions --- sessions.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sessions.php b/sessions.php index 608323a43..39a83eed8 100644 --- a/sessions.php +++ b/sessions.php @@ -12,7 +12,7 @@ ini_set("session.use_only_cookies", true); ini_set("session.gc_maxlifetime", SESSION_EXPIRE_TIME); - function open ($s, $n) { + function ttrss_open ($s, $n) { global $session_connection; @@ -21,7 +21,7 @@ return true; } - function read ($id){ + function ttrss_read ($id){ global $session_connection,$session_read; @@ -38,7 +38,7 @@ } } - function write ($id, $data) { + function ttrss_write ($id, $data) { if (! $data) { return false; @@ -62,7 +62,7 @@ return true; } - function close () { + function ttrss_close () { global $session_connection; @@ -71,7 +71,7 @@ return true; } - function destroy ($id) { + function ttrss_destroy ($id) { global $session_connection; @@ -82,7 +82,7 @@ return true; } - function gc ($expire) { + function ttrss_gc ($expire) { global $session_connection; @@ -92,7 +92,9 @@ } if (DATABASE_BACKED_SESSIONS) { - session_set_save_handler("open", "close", "read", "write", "destroy", "gc"); + session_set_save_handler("ttrss_open", + "ttrss_close", "ttrss_read", "ttrss_write", + "ttrss_destroy", "ttrss_gc"); } session_set_cookie_params(SESSION_COOKIE_LIFETIME); From ceb0cab568051f1593571904158f30532a63dd4e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 22 Nov 2009 22:56:05 +0300 Subject: [PATCH 2/3] generate_syndicated_feed: properly pass owner_uid to sanitize_rss() (closes #256) --- functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/functions.php b/functions.php index 0dae38842..c20ea020a 100644 --- a/functions.php +++ b/functions.php @@ -3528,7 +3528,7 @@ print ""; } - print sanitize_rss($link, $line["content_preview"]); + print sanitize_rss($link, $line["content_preview"], false, $owner_uid); print "]]>"; print ""; @@ -3590,10 +3590,12 @@ } */ - function sanitize_rss($link, $str, $force_strip_tags = false) { + function sanitize_rss($link, $str, $force_strip_tags = false, $owner = false) { $res = $str; - if (get_pref($link, "STRIP_UNSAFE_TAGS") || $force_strip_tags) { + if (!$owner) $owner = $_SESSION["uid"]; + + if (get_pref($link, "STRIP_UNSAFE_TAGS", $owner) || $force_strip_tags) { // $res = strip_tags_long($res, // "