ignore forbidden tags on missed search counter
This commit is contained in:
@@ -2,7 +2,7 @@ module PostsHelper
|
||||
def missed_post_search_count_js
|
||||
return nil unless Danbooru.config.enable_post_search_counts
|
||||
|
||||
if params[:ms] == "1" && params[:tags].to_s.scan(/\S+/).size == 1
|
||||
if params[:ms] == "1" && @post_set.post_count == 0 && @post_set.is_single_tag?
|
||||
session_id = session.id
|
||||
digest = OpenSSL::Digest.new("sha256")
|
||||
sig = OpenSSL::HMAC.hexdigest(digest, Danbooru.config.shared_remote_key, ",#{session_id}")
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
var tags = $("#tags").val();
|
||||
if ($(".post-preview").size() === 0) {
|
||||
$.post("<%= Danbooru.config.report_server %>/missed_searches", {
|
||||
session_id: "<%= session_id %>",
|
||||
tags: tags,
|
||||
sig: "<%= sig %>"
|
||||
});
|
||||
}
|
||||
$.post("<%= Danbooru.config.report_server %>/missed_searches", {
|
||||
session_id: "<%= session_id %>",
|
||||
tags: tags,
|
||||
sig: "<%= sig %>"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -233,7 +233,7 @@ module Danbooru
|
||||
end
|
||||
|
||||
def can_user_see_post?(user, post)
|
||||
if is_user_restricted?(user) && is_post_restricted?(post)
|
||||
if is_user_restricted?(user) && is_post_restricted?(post)
|
||||
false
|
||||
else
|
||||
true
|
||||
|
||||
Reference in New Issue
Block a user