From: Andrew Dolgov Date: Mon, 21 Nov 2005 07:27:17 +0000 (+0100) Subject: fix possible bug in tag-processing part of update_rss_feed X-Git-Tag: schema_feature_freeze_for_1.1~149 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=fe99ab12bb0fbbab3dc513e421d9c29536fb15d6;p=tt-rss.git fix possible bug in tag-processing part of update_rss_feed --- diff --git a/backend.php b/backend.php index 6a0a02ec..f1a3f75c 100644 --- a/backend.php +++ b/backend.php @@ -1969,7 +1969,8 @@ "; $result = db_query($link, "SELECT - id,login,access_level,last_login + id,login,access_level, + SUBSTRING(last_login,1,16) as last_login FROM ttrss_users ORDER by login"); @@ -2090,7 +2091,9 @@ print "
"; - $result = db_query($link, "SELECT login,last_login,access_level, + $result = db_query($link, "SELECT login, + SUBSTRING(last_login,1,16) AS last_login, + access_level, (SELECT COUNT(int_id) FROM ttrss_user_entries WHERE owner_uid = id) AS stored_articles FROM ttrss_users diff --git a/functions.php b/functions.php index 35460efb..0d4ee78d 100644 --- a/functions.php +++ b/functions.php @@ -414,32 +414,31 @@ AND feed_id = '$feed' AND ref_id = id AND owner_uid = '$owner_uid'"); - if (!$result || db_num_rows($result) != 1) { - return; - } - - $entry_id = db_fetch_result($result, 0, "id"); - $entry_int_id = db_fetch_result($result, 0, "int_id"); - - foreach ($entry_tags as $tag) { - $tag = db_escape_string(strtolower($tag)); - - $tag = str_replace("technorati tag: ", "", $tag); - - $result = db_query($link, "SELECT id FROM ttrss_tags - WHERE tag_name = '$tag' AND post_int_id = '$entry_int_id' AND - owner_uid = '$owner_uid' LIMIT 1"); - -// print db_fetch_result($result, 0, "id"); - - if ($result && db_num_rows($result) == 0) { - -// print "tagging $entry_id as $tag
"; + if (db_num_rows($result) == 1) { - db_query($link, "INSERT INTO ttrss_tags - (owner_uid,tag_name,post_int_id) - VALUES ('$owner_uid','$tag', '$entry_int_id')"); - } + $entry_id = db_fetch_result($result, 0, "id"); + $entry_int_id = db_fetch_result($result, 0, "int_id"); + + foreach ($entry_tags as $tag) { + $tag = db_escape_string(strtolower($tag)); + + $tag = str_replace("technorati tag: ", "", $tag); + + $result = db_query($link, "SELECT id FROM ttrss_tags + WHERE tag_name = '$tag' AND post_int_id = '$entry_int_id' AND + owner_uid = '$owner_uid' LIMIT 1"); + + // print db_fetch_result($result, 0, "id"); + + if ($result && db_num_rows($result) == 0) { + + // print "tagging $entry_id as $tag
"; + + db_query($link, "INSERT INTO ttrss_tags + (owner_uid,tag_name,post_int_id) + VALUES ('$owner_uid','$tag', '$entry_int_id')"); + } + } } } }