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