mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-25 10:46:15 +03:00
Don't try to apply Mark-of-the-Web to nonexistent files
Trying to apply it to a nonexistent file is unacceptable, as it may unexpectedly create such a file. PR #21488. Closes #21440.
This commit is contained in:
parent
dd7ef8e934
commit
387821267f
1 changed files with 5 additions and 0 deletions
|
@ -271,6 +271,11 @@ Path Utils::OS::windowsSystemPath()
|
||||||
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||||
bool Utils::OS::applyMarkOfTheWeb(const Path &file, const QString &url)
|
bool Utils::OS::applyMarkOfTheWeb(const Path &file, const QString &url)
|
||||||
{
|
{
|
||||||
|
// Trying to apply this to a non-existent file is unacceptable,
|
||||||
|
// as it may unexpectedly create such a file.
|
||||||
|
if (!file.exists())
|
||||||
|
return false;
|
||||||
|
|
||||||
Q_ASSERT(url.isEmpty() || url.startsWith(u"http:") || url.startsWith(u"https:"));
|
Q_ASSERT(url.isEmpty() || url.startsWith(u"http:") || url.startsWith(u"https:"));
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
|
|
Loading…
Reference in a new issue