nodebb-plugin-composer-default 9.2.3 → 9.2.5

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, ',') : (req.query.title || '');
191
+ const topicTitle = topicData && topicData.title ? topicData.title.replace(/%/g, '%').replace(/,/g, ',') : validator.escape(String(req.query.title || ''));
192
192
  return {
193
193
  req: req,
194
194
  res: res,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "9.2.3",
3
+ "version": "9.2.5",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -71,12 +71,14 @@ define('composer/autocomplete', [
71
71
  return;
72
72
  }
73
73
  var editor;
74
- if (targetEl.nodeName === 'TEXTAREA') {
74
+ if (targetEl.nodeName === 'TEXTAREA' || targetEl.nodeName === 'INPUT') {
75
75
  editor = new TextareaEditor(targetEl);
76
76
  } else if (targetEl.nodeName === 'DIV' && targetEl.getAttribute('contenteditable') === 'true') {
77
77
  editor = new ContenteditableEditor(targetEl);
78
78
  }
79
-
79
+ if (!editor) {
80
+ throw new Error('unknown target element type');
81
+ }
80
82
  // yuku-t/textcomplete inherits directionality from target element itself
81
83
  targetEl.setAttribute('dir', document.querySelector('html').getAttribute('data-dir'));
82
84