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.
- package/library.js +4 -9
- 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
|
-
|
|
124
|
-
|
|
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
|
}
|