mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 16:15:47 +08:00
SECURITY: escape cat name (#14154)
This commit is contained in:
parent
841e054907
commit
75b0d6df93
app/assets/javascripts/discourse/app
@ -8,6 +8,7 @@ import { ajax } from "discourse/lib/ajax";
|
||||
import { get } from "@ember/object";
|
||||
import { getOwner } from "discourse-common/lib/get-owner";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { escapeExpression } from "discourse/lib/utilities";
|
||||
|
||||
const STAFF_GROUP_NAME = "staff";
|
||||
|
||||
@ -56,6 +57,11 @@ const Category = RestModel.extend({
|
||||
return { type: "category", id, category: this };
|
||||
},
|
||||
|
||||
@discourseComputed("name")
|
||||
escapeName(name) {
|
||||
return escapeExpression(name);
|
||||
},
|
||||
|
||||
@discourseComputed("parentCategory.ancestors")
|
||||
ancestors(parentAncestors) {
|
||||
return [...(parentAncestors || []), this];
|
||||
|
@ -4,7 +4,7 @@
|
||||
{{#if category.read_restricted}}
|
||||
{{d-icon lockIcon}}
|
||||
{{/if}}
|
||||
<span class="category-name">{{dir-span category.name}}</span>
|
||||
<span class="category-name">{{dir-span category.escapeName}}</span>
|
||||
</div>
|
||||
{{#if category.uploaded_logo.url}}
|
||||
{{cdn-img
|
||||
|
Loading…
x
Reference in New Issue
Block a user