Fix #3813: Favorite limit can be bypassed.
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
<% if @error_msg %>
|
||||
$(window).trigger("danbooru:error", "<%= @error_msg %>");
|
||||
<% else %>
|
||||
$("#add-to-favorites").hide();
|
||||
$("#add-fav-button").hide();
|
||||
$("#remove-from-favorites").show();
|
||||
$("#remove-fav-button").show();
|
||||
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
||||
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
||||
<% if CurrentUser.is_gold? %>
|
||||
$("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
|
||||
if (!$("#favlist").is(":visible")) {
|
||||
$("#show-favlist-link").show();
|
||||
}
|
||||
<% end %>
|
||||
$(window).trigger("danbooru:notice", "You have favorited this post");
|
||||
$("#add-to-favorites").hide();
|
||||
$("#add-fav-button").hide();
|
||||
$("#remove-from-favorites").show();
|
||||
$("#remove-fav-button").show();
|
||||
$("#score-for-post-<%= @post.id %>").html(<%= @post.score %>);
|
||||
$("#favcount-for-post-<%= @post.id %>").html(<%= @post.fav_count %>);
|
||||
<% if CurrentUser.is_gold? %>
|
||||
$("#favlist").html("<%= escape_javascript(post_favlist(@post)) %>");
|
||||
if (!$("#favlist").is(":visible")) {
|
||||
$("#show-favlist-link").show();
|
||||
}
|
||||
<% end %>
|
||||
$(window).trigger("danbooru:notice", "You have favorited this post");
|
||||
|
||||
2
app/views/static/error.js.erb
Normal file
2
app/views/static/error.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
var message = <%= raw @error_message.try(:to_json) || @exception.message.to_json %>;
|
||||
Danbooru.Utility.error(message);
|
||||
Reference in New Issue
Block a user