-
Notifications
You must be signed in to change notification settings - Fork 816
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5055 from nextcloud/backport/5039/bugfix/checkTok…
…enForEditLocallyRequests Backport/5039/bugfix/check token for edit locally requests
- Loading branch information
Showing
5 changed files
with
187 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ | |
#include <QMessageBox> | ||
#include <QDesktopServices> | ||
#include <QGuiApplication> | ||
#include <QUrlQuery> | ||
|
||
class QSocket; | ||
|
||
|
@@ -764,8 +765,16 @@ void Application::handleEditLocally(const QUrl &url) const | |
// for a sample URL "nc://open/[email protected]:8080/Photos/lovely.jpg", QUrl::path would return "[email protected]:8080/Photos/lovely.jpg" | ||
const auto accountDisplayName = pathSplit.takeFirst(); | ||
const auto fileRemotePath = pathSplit.join('/'); | ||
const auto urlQuery = QUrlQuery{url}; | ||
|
||
FolderMan::instance()->editFileLocally(accountDisplayName, fileRemotePath); | ||
auto token = QString{}; | ||
if (urlQuery.hasQueryItem(QStringLiteral("token"))) { | ||
token = urlQuery.queryItemValue(QStringLiteral("token")); | ||
} else { | ||
qCWarning(lcApplication) << "Invalid URL for file local editing: missing token"; | ||
} | ||
|
||
FolderMan::instance()->editFileLocally(accountDisplayName, fileRemotePath, token); | ||
} | ||
|
||
QString substLang(const QString &lang) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters