From 64436e103915e02f8c926639646002b60055dbbd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 7 Jun 2012 10:09:07 +0400 Subject: prevent session modification in public/share --- include/functions.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 5eb5b97af..3ad438d86 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3102,7 +3102,7 @@ if ($tag_cache === false) { $result = db_query($link, "SELECT tag_cache FROM ttrss_user_entries - WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]); + WHERE ref_id = '$id' AND owner_uid = $owner_uid"); $tag_cache = db_fetch_result($result, 0, "tag_cache"); } @@ -3125,7 +3125,7 @@ db_query($link, "UPDATE ttrss_user_entries SET tag_cache = '$tags_str' WHERE ref_id = '$id' - AND owner_uid = " . $_SESSION["uid"]); + AND owner_uid = $owner_uid"); } if ($memcache) $memcache->add($obj_id, $tags, 0, 3600); @@ -3251,7 +3251,9 @@ return $entry; } - function format_article($link, $id, $mark_as_read = true, $zoom_mode = false) { + function format_article($link, $id, $mark_as_read = true, $zoom_mode = false, $owner_uid = false) { + + if (!$owner_uid) $owner_uid = $_SESSION["uid"]; $rv = array(); @@ -3270,7 +3272,7 @@ //if (!$zoom_mode) { print "
$parsed_updated"; @@ -3378,7 +3380,7 @@ $tag_cache = $line["tag_cache"]; if (!$tag_cache) - $tags = get_article_tags($link, $id); + $tags = get_article_tags($link, $id, $owner_uid); else $tags = explode(",", $tag_cache); @@ -3472,7 +3474,7 @@ $rv['content'] .= "
"; - $article_content = sanitize($link, $line["content"], false, false, + $article_content = sanitize($link, $line["content"], false, $owner_uid, $feed_site_url); $rv['content'] .= $article_content; -- cgit v1.2.3