nodebb-plugin-composer-default 10.0.36 → 10.0.37

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.
Files changed (2) hide show
  1. package/library.js +4 -9
  2. package/package.json +1 -1
package/library.js CHANGED
@@ -120,17 +120,12 @@ plugin.filterComposerBuild = async function (hookData) {
120
120
  const { res } = hookData;
121
121
 
122
122
  if (req.query.p) {
123
- if (!res.locals.isAPI) {
124
- let a;
125
- try {
126
- a = url.parse(req.query.p, true, true);
127
- } catch (e) {
128
- return helpers.redirect(res, '/');
129
- }
123
+ try {
124
+ const a = url.parse(req.query.p, true, true);
130
125
  return helpers.redirect(res, `/${(a.path || '').replace(/^\/*/, '')}`);
126
+ } catch (e) {
127
+ return helpers.redirect(res, '/');
131
128
  }
132
- res.render('', {});
133
- return;
134
129
  } else if (!req.query.pid && !req.query.tid && !req.query.cid) {
135
130
  return helpers.redirect(res, '/');
136
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "10.0.36",
3
+ "version": "10.0.37",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {