A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: webserver folder creation regex change (#653)

## Summary

Resolves #562

Implements regex change to support valid characters discussed by
@daveallie in issue
[here](https://github.com/crosspoint-reader/crosspoint-reader/issues/562#issuecomment-3830809156).

Also rejects `.` and `..` as folder names which are invalid in FAT32 and
exFAT filesystems

## Additional Context
- Unsure on the wording for the alert, it feels overly explicit, but
that might be a good thing. Happy to change.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**< PARTIALLY >**_

authored by

Aaron Cunliffe and committed by
GitHub
f67c544e e5c0ddc9

+4 -4
+1 -1
docs/webserver.md
··· 153 153 154 154 1. Click the **+ Add** button in the top-right corner 155 155 2. Select **New Folder** from the dropdown menu 156 - 3. Enter a folder name (letters, numbers, underscores, and hyphens only) 156 + 3. Enter a folder name (must not contain characters \" * : < > ? / \\ | and must not be . or ..) 157 157 4. Click **Create Folder** 158 158 159 159 This is useful for organizing your ebooks by genre, author, or series.
+3 -3
src/network/html/FilesPage.html
··· 1146 1146 return; 1147 1147 } 1148 1148 1149 - // Validate folder name (no special characters except underscore and hyphen) 1150 - const validName = /^[a-zA-Z0-9_\-]+$/.test(folderName); 1149 + // Validate folder name 1150 + const validName = /^(?!\.{1,2}$)[^"*:<>?\/\\|]+$/.test(folderName); 1151 1151 if (!validName) { 1152 - alert('Folder name can only contain letters, numbers, underscores, and hyphens.'); 1152 + alert('Folder name cannot contain \" * : < > ? / \\ | and must not be . or ..'); 1153 1153 return; 1154 1154 } 1155 1155