Permalink
Show file tree
Hide file tree
16 changes: 8 additions & 8 deletions
16
app/assets/javascripts/discourse/tests/helpers/create-pretender.js
2 changes: 1 addition & 1 deletion
2
app/assets/javascripts/discourse/tests/integration/components/select-kit/tag-drop-test.js
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
SECURITY: Hide PM count for tags by default (#20061)
Currently `Topic#pm_topic_count` is a count of all personal messages tagged for a given tag. As a result, any user with access to PM tags can poll a sensitive tag to determine if a new personal message has been created using that tag even if the user does not have access to the personal message. We classify this as a minor leak in sensitive information. With this commit, `Topic#pm_topic_count` is hidden from users by default unless the `display_personal_messages_tag_counts` site setting is enabled.
- Loading branch information
Showing
8 changed files
with
127 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
app/assets/javascripts/discourse/tests/unit/models/tag-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import { module, test } from "qunit"; | ||
| import { getOwner } from "discourse-common/lib/get-owner"; | ||
| import { setupTest } from "ember-qunit"; | ||
|
|
||
| module("Unit | Model | tag", function (hooks) { | ||
| setupTest(hooks); | ||
|
|
||
| hooks.beforeEach(function () { | ||
| this.store = getOwner(this).lookup("service:store"); | ||
| }); | ||
|
|
||
| test("totalCount when pm_count is not present", function (assert) { | ||
| const tag = this.store.createRecord("tag", { count: 5 }); | ||
| assert.strictEqual(tag.totalCount, 5); | ||
| }); | ||
|
|
||
| test("totalCount when pm_count is present", function (assert) { | ||
| const tag = this.store.createRecord("tag", { count: 5, pm_count: 8 }); | ||
| assert.strictEqual(tag.totalCount, 13); | ||
| }); | ||
|
|
||
| test("pmOnly", function (assert) { | ||
| const tag = this.store.createRecord("tag", { pm_only: false }); | ||
|
|
||
| assert.notOk(tag.pmOnly); | ||
|
|
||
| tag.set("pm_only", true); | ||
|
|
||
| assert.ok(tag.pmOnly); | ||
| }); | ||
| }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters