mirror of
https://github.com/discourse/discourse.git
synced 2024-12-16 05:23:48 +08:00
SECURITY: User action route was returning too much data
This commit is contained in:
parent
9ad246affe
commit
8ced44a766
|
@ -256,9 +256,10 @@ Discourse.User = Discourse.Model.extend({
|
|||
var self = this,
|
||||
stream = this.get('stream');
|
||||
return Discourse.ajax("/user_actions/" + id + ".json", { cache: 'false' }).then(function(result) {
|
||||
if (result) {
|
||||
if ((self.get('stream.filter') || result.action_type) !== result.action_type) return;
|
||||
var action = Discourse.UserAction.collapseStream([Discourse.UserAction.create(result)]);
|
||||
if (result && result.user_action) {
|
||||
var ua = result.user_action;
|
||||
if ((self.get('stream.filter') || ua.action_type) !== ua.action_type) return;
|
||||
var action = Discourse.UserAction.collapseStream([Discourse.UserAction.create(ua)]);
|
||||
stream.set('itemsLoaded', stream.get('itemsLoaded') + 1);
|
||||
stream.get('content').insertAt(0, action[0]);
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class UserActionsController < ApplicationController
|
|||
|
||||
def show
|
||||
params.require(:id)
|
||||
render json: UserAction.stream_item(params[:id], guardian)
|
||||
render_serialized(UserAction.stream_item(params[:id], guardian), UserActionSerializer)
|
||||
end
|
||||
|
||||
def private_messages
|
||||
|
|
Loading…
Reference in New Issue
Block a user