nodebb-plugin-composer-default 9.2.0 → 9.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/library.js CHANGED
@@ -188,7 +188,7 @@ plugin.filterComposerBuild = async function (hookData) {
188
188
  }
189
189
  globalPrivileges['topics:tag'] = canTagTopics;
190
190
  const cid = parseInt(req.query.cid, 10);
191
- const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : '';
191
+ const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : req.query.title;
192
192
  return {
193
193
  req: req,
194
194
  res: res,
@@ -254,8 +254,8 @@ async function generateBody(req, postData) {
254
254
  const translated = await translator.translate(`[[modules:composer.user_said, ${username}]]`);
255
255
  return `${translated}\n` +
256
256
  `> ${postData ? `${postData.content.replace(/\n/g, '\n> ')}\n\n` : ''}`;
257
- } else if (req.query.body) {
258
- return req.query.body;
257
+ } else if (req.query.body || req.query.content) {
258
+ return validator.escape(String(req.query.body || req.query.content));
259
259
  }
260
260
  return postData ? postData.content : '';
261
261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "9.2.0",
3
+ "version": "9.2.2",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -91,7 +91,7 @@
91
91
  [[modules:composer.compose]] <span class="help hidden"><i class="fa fa-question-circle"></i></span>
92
92
  <span class="toggle-preview hide">[[modules:composer.show_preview]]</span>
93
93
  </div>
94
- <textarea name="content" form="compose-form" class="write" tabindex="5" placeholder="[[modules:composer.textarea.placeholder]]"></textarea>
94
+ <textarea name="content" form="compose-form" class="write" tabindex="5" placeholder="[[modules:composer.textarea.placeholder]]">{body}</textarea>
95
95
  </div>
96
96
  <div class="col-md-6 hidden-sm hidden-xs preview-container">
97
97
  <div class="help-text">