nodebb-plugin-composer-default 10.3.10 → 10.3.11
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 +3 -2
- package/package.json +1 -1
- package/static/lib/composer.js +7 -4
package/library.js
CHANGED
|
@@ -103,8 +103,9 @@ plugin.filterComposerBuild = async function (hookData) {
|
|
|
103
103
|
|
|
104
104
|
if (req.query.p) {
|
|
105
105
|
try {
|
|
106
|
-
const a =
|
|
107
|
-
|
|
106
|
+
const a = new URL(req.query.p, 'http://localhost.com');
|
|
107
|
+
const path = (a.pathname + a.search).replace(/^\/+/, '');
|
|
108
|
+
return helpers.redirect(res, `/${path}`);
|
|
108
109
|
} catch (e) {
|
|
109
110
|
return helpers.redirect(res, '/');
|
|
110
111
|
}
|
package/package.json
CHANGED
package/static/lib/composer.js
CHANGED
|
@@ -566,20 +566,23 @@ define('composer', [
|
|
|
566
566
|
var returnPath = window.location.pathname.slice(1) + window.location.search;
|
|
567
567
|
|
|
568
568
|
// Remove relative path from returnPath
|
|
569
|
-
if (returnPath.startsWith(config.relative_path.slice(1))) {
|
|
570
|
-
returnPath = returnPath.slice(config.relative_path.length);
|
|
569
|
+
if (config.relative_path && returnPath.startsWith(config.relative_path.slice(1))) {
|
|
570
|
+
returnPath = returnPath.slice(config.relative_path.length - 1);
|
|
571
|
+
if (returnPath.startsWith('/')) {
|
|
572
|
+
returnPath = returnPath.slice(1);
|
|
573
|
+
}
|
|
571
574
|
}
|
|
572
575
|
|
|
573
576
|
// Add in return path to be caught by ajaxify when post is completed, or if back is pressed
|
|
574
577
|
window.history.replaceState({
|
|
575
578
|
url: null,
|
|
576
579
|
returnPath: returnPath,
|
|
577
|
-
},
|
|
580
|
+
}, '', `${config.relative_path}/${returnPath}`);
|
|
578
581
|
|
|
579
582
|
// Update address bar in case f5 is pressed
|
|
580
583
|
window.history.pushState({
|
|
581
584
|
url: path,
|
|
582
|
-
},
|
|
585
|
+
}, '', `${config.relative_path}/${returnPath}`);
|
|
583
586
|
}
|
|
584
587
|
|
|
585
588
|
function handleRemotePid(postContainer) {
|