[PR #4393] [MERGED] Fix filesystem pathexists path join #4236

Closed
opened 2026-04-25 00:18:56 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/4393
Author: @advplyr
Created: 6/11/2025
Status: Merged
Merged: 6/11/2025
Merged by: @advplyr

Base: masterHead: fix_pathexists_join


📝 Commits (1)

  • 0135b35 Fix filesystem pathexists path join

📊 Changes

1 file changed (+2 additions, -2 deletions)

View changed files

📝 server/controllers/FileSystemController.js (+2 -2)

📄 Description

Brief summary

This is a follow up to #4342 to fix an edge case

Which issue is fixed?

No issue

In-depth Description

When using Path.posix.join with a posix file path and a Windows file path the resulting join isn't normalized.

For example:

Path.posix.join("C:/Users/Test/audiobooks", "..\\test")

returns C:/Users/Test/audiobooks/..\test

Path.join returns C:/Users/Test/test as expected

This is an issue because fs.pathExists is normalizing the posix and non-posix path

How have you tested this?

Making API calls. The web ui doesn't use relative paths.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/4393 **Author:** [@advplyr](https://github.com/advplyr) **Created:** 6/11/2025 **Status:** ✅ Merged **Merged:** 6/11/2025 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `fix_pathexists_join` --- ### 📝 Commits (1) - [`0135b35`](https://github.com/advplyr/audiobookshelf/commit/0135b3560c1760cf582db0a040c7f2e0f93810a6) Fix filesystem pathexists path join ### 📊 Changes **1 file changed** (+2 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/controllers/FileSystemController.js` (+2 -2) </details> ### 📄 Description <!-- For Work In Progress Pull Requests, please use the Draft PR feature, see https://github.blog/2019-02-14-introducing-draft-pull-requests/ for further details. If you do not follow this template, the PR may be closed without review. Please ensure all checks pass. If you are a new contributor, the workflows will need to be manually approved before they run. --> ## Brief summary This is a follow up to #4342 to fix an edge case ## Which issue is fixed? No issue ## In-depth Description When using `Path.posix.join` with a posix file path and a Windows file path the resulting join isn't normalized. For example: ```js Path.posix.join("C:/Users/Test/audiobooks", "..\\test") ``` returns `C:/Users/Test/audiobooks/..\test` `Path.join` returns `C:/Users/Test/test` as expected This is an issue because `fs.pathExists` is normalizing the posix and non-posix path ## How have you tested this? Making API calls. The web ui doesn't use relative paths. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:18:56 +02:00
adam closed this issue 2026-04-25 00:18:56 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#4236