Skip to content

Commit

Permalink
Merge pull request #2767 from inkz/patch-1
Browse files Browse the repository at this point in the history
Update RTEDemoApi.js
  • Loading branch information
AlekseyManetov authored Feb 27, 2025
2 parents 5415240 + 69a6b2b commit fe5bbb1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions server/api/RTEDemoApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ const path = require('path');
const { sortBy } = require('lodash');

router.post('/get-demo-doc-content', (req, res) => {
const docContentPath = path.join(__dirname, '../../public/rte_contents/', `${req.body.name}`);

const contentDir = path.join(__dirname, '../../public/rte_contents/');
const docContentPath = path.resolve(contentDir, `${req.body.name}`);
if (!docContentPath.startsWith(contentDir)) {
res.send(null);
}
if (!fs.existsSync(docContentPath)) {
res.send(null);
} else {
Expand Down

0 comments on commit fe5bbb1

Please sign in to comment.