Browse Source

Simplify find syntax.

master
Andrius Štikonas 3 months ago
parent
commit
04a095a542
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/util/externalcommandhelper.cpp

+ 1
- 1
src/util/externalcommandhelper.cpp View File

@ -302,7 +302,7 @@ QVariantMap ExternalCommandHelper::RunCommand(const QString& command, const QStr
// Compare with command whitelist
QString basename = command.mid(command.lastIndexOf(QLatin1Char('/')) + 1);
if (std::find(std::begin(allowedCommands), std::end(allowedCommands), basename) == std::end(allowedCommands)) {
if (allowedCommands.find(basename) == allowedCommands.end()) { // TODO: C++20: replace with contains
qInfo() << command <<" command is not one of the whitelisted command";
reply[QStringLiteral("success")] = false;
return reply;


Loading…
Cancel
Save