aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-05-31 14:54:32 -0500
committerJP Dillingham <jp@dillingham.me>2026-05-31 14:54:32 -0500
commit2926ef6ee1c9151d72ae9ab5d713630b299224ed (patch)
tree4db2f3e161545314dc21cc368b847ec636f9f0fa /src
parent058b02ea093f4d7867441d055bef2b857eb98dd0 (diff)
downloadslskd-2926ef6ee1c9151d72ae9ab5d713630b299224ed.tar.gz
use method instead of inline
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Common/FileSafety.cs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/slskd/Common/FileSafety.cs b/src/slskd/Common/FileSafety.cs
index ebd9a69c..011a7a70 100644
--- a/src/slskd/Common/FileSafety.cs
+++ b/src/slskd/Common/FileSafety.cs
@@ -369,11 +369,7 @@ public static class FileSafety
if (!retainRoot)
{
// strip C:\ or //server, if present (regardless of slash variant, etc)
- path = DriveRootRegex.Replace(path, string.Empty);
- path = UncRootRegex.Replace(path, string.Empty);
-
- // strip @@abcde prefixes used by SoulseekQt to obscure paths
- path = SoulseekQtRootRegex.Replace(path, string.Empty);
+ path = StripPathRoot(path);
}
// for each segment, drop nulls (created by double slashes), sanitize, and replace traversal strings