From ee3416166609a2174e360bf4f09a96caf7aab4af Mon Sep 17 00:00:00 2001 From: onasilos Date: Mon, 22 Sep 2025 11:51:32 +0300 Subject: [PATCH] fix: unsafe string replacement when handling public paths --- apps/web/scripts/pullLatestBlogPosts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/scripts/pullLatestBlogPosts.js b/apps/web/scripts/pullLatestBlogPosts.js index 9a489ef04e3..400e64ef120 100644 --- a/apps/web/scripts/pullLatestBlogPosts.js +++ b/apps/web/scripts/pullLatestBlogPosts.js @@ -163,7 +163,7 @@ async function main() { const publicImagePath = path.join('public', 'images', 'blog', fileName); await downloadImage(post.imageUrl, publicImagePath); - post.publicImagePath = publicImagePath.replace('public', ''); + post.publicImagePath = '/' + path.relative('public', publicImagePath); } // Save the results as JSON