Skip to content

Usenet streaming with a WebDAV server and a SABnzbd-compatible API

C#

Fix: Allow special characters for filename-passwords (#308)

Root-Coredf8b84515f7b
diff --git a/backend/Utils/FilenameUtil.cs b/backend/Utils/FilenameUtil.cs
index 6f847537..7d6421a5 100644
--- a/backend/Utils/FilenameUtil.cs
+++ b/backend/Utils/FilenameUtil.cs
@@ -7,7 +7,8 @@ public partial class FilenameUtil
// Group `pw` contains the password,
// Group `rm` contains the part of the filename that should be removed to create a clean job name
// Group `br` ensures that the brackets are closed / is used for back reference
- [GeneratedRegex(@"(?<rm>[\s-]*(?:(?<br>{{)|password=)(?<pw>\w+)(?(br)}}))\.nzb$", RegexOptions.IgnoreCase)]
+ // Tests: https://regex101.com/r/qsIcnE/1
+ [GeneratedRegex(@"(?<rm>[\s-]*(?:(?<br>{{)|password=)(?<pw>.+)(?(br)}}))\.nzb$", RegexOptions.IgnoreCase)]
public static partial Regex PasswordRegex { get; }
private static readonly HashSet<string> VideoExtensions =