mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
- Validate label names to make sure there is no character forbidden by the file system
This commit is contained in:
parent
2b289655c1
commit
037e57b687
4 changed files with 49 additions and 11 deletions
14
src/misc.h
14
src/misc.h
|
@ -183,6 +183,20 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
static QString toValidFileSystemName(QString filename) {
|
||||
filename = filename.replace("\\", "/");
|
||||
QRegExp regex("[/:!?\"*<>|]");
|
||||
return filename.replace(regex, " ");
|
||||
}
|
||||
|
||||
static bool isValidFileSystemName(QString filename) {
|
||||
filename = filename.replace("\\", "/");
|
||||
QRegExp regex("[/:!?\"*<>|]");
|
||||
if(filename.contains(regex))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef Q_WS_MAC
|
||||
static QString getFullPath(const FSRef &ref)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue