1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-23 16:11:28 +00:00

fix tag caching issues

This commit is contained in:
Andrew Dolgov
2010-11-10 11:08:33 +03:00
parent 5eeb387497
commit 779560b7a3
2 changed files with 36 additions and 22 deletions

View File

@@ -424,7 +424,6 @@
$tags_str = db_escape_string($_REQUEST["tags_str"]);
$tags = array_unique(trim_array(split(",", $tags_str)));
$tags_str = db_escape_string(join(",", $tags));
db_query($link, "BEGIN");
@@ -433,6 +432,8 @@
if (db_num_rows($result) == 1) {
$tags_to_cache = array();
$int_id = db_fetch_result($result, 0, "int_id");
db_query($link, "DELETE FROM ttrss_tags WHERE
@@ -455,12 +456,18 @@
db_query($link, "INSERT INTO ttrss_tags
(post_int_id, owner_uid, tag_name) VALUES ('$int_id', '".$_SESSION["uid"]."', '$tag')");
}
}
}
db_query($link, "UPDATE ttrss_user_entries
SET tag_cache = '$tags_str' WHERE ref_id = '$id'
AND owner_uid = " . $_SESSION["uid"]);
array_push($tags_to_cache, $tag);
}
/* update tag cache */
$tags_str = join(",", $tags_to_cache);
db_query($link, "UPDATE ttrss_user_entries
SET tag_cache = '$tags_str' WHERE ref_id = '$id'
AND owner_uid = " . $_SESSION["uid"]);
}
db_query($link, "COMMIT");