Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jsonrpc: fix passing of paths to builtin methods (fixes #14066)

  • Loading branch information...
commit bee7aeb42812c21655368923ee1047d8ffbc02da 1 parent 3715563
@Montellese Montellese authored
View
3  xbmc/interfaces/json-rpc/AddonsOperations.cpp
@@ -27,6 +27,7 @@
#include "ApplicationMessenger.h"
#include "TextureCache.h"
#include "filesystem/File.h"
+#include "utils/StringUtils.h"
using namespace std;
using namespace JSONRPC;
@@ -187,7 +188,7 @@ JSONRPC_STATUS CAddonsOperations::ExecuteAddon(const CStdString &method, ITransp
{
if (it != params.begin_array())
argv += ",";
- argv += it->asString();
+ argv += StringUtils::Paramify(it->asString());
}
}
View
5 xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -22,6 +22,7 @@
#include "music/MusicDatabase.h"
#include "FileItem.h"
#include "Util.h"
+#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "music/tags/MusicInfoTag.h"
#include "music/Artist.h"
@@ -531,7 +532,7 @@ JSONRPC_STATUS CAudioLibrary::Scan(const CStdString &method, ITransportLayer *tr
if (directory.empty())
cmd = "updatelibrary(music)";
else
- cmd.Format("updatelibrary(music, %s)", directory.c_str());
+ cmd.Format("updatelibrary(music, %s)", StringUtils::Paramify(directory).c_str());
CApplicationMessenger::Get().ExecBuiltIn(cmd);
return ACK;
@@ -541,7 +542,7 @@ JSONRPC_STATUS CAudioLibrary::Export(const CStdString &method, ITransportLayer *
{
CStdString cmd;
if (parameterObject["options"].isMember("path"))
- cmd.Format("exportlibrary(music, false, %s)", parameterObject["options"]["path"].asString());
+ cmd.Format("exportlibrary(music, false, %s)", StringUtils::Paramify(parameterObject["options"]["path"].asString()));
else
cmd.Format("exportlibrary(music, true, %s, %s)",
parameterObject["options"]["images"].asBoolean() ? "true" : "false",
View
5 xbmc/interfaces/json-rpc/VideoLibrary.cpp
@@ -22,6 +22,7 @@
#include "ApplicationMessenger.h"
#include "TextureCache.h"
#include "Util.h"
+#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "video/VideoDatabase.h"
@@ -654,7 +655,7 @@ JSONRPC_STATUS CVideoLibrary::Scan(const CStdString &method, ITransportLayer *tr
if (directory.empty())
cmd = "updatelibrary(video)";
else
- cmd.Format("updatelibrary(video, %s)", directory.c_str());
+ cmd.Format("updatelibrary(video, %s)", StringUtils::Paramify(directory).c_str());
CApplicationMessenger::Get().ExecBuiltIn(cmd);
return ACK;
@@ -664,7 +665,7 @@ JSONRPC_STATUS CVideoLibrary::Export(const CStdString &method, ITransportLayer *
{
CStdString cmd;
if (parameterObject["options"].isMember("path"))
- cmd.Format("exportlibrary(video, false, %s)", parameterObject["options"]["path"].asString());
+ cmd.Format("exportlibrary(video, false, %s)", StringUtils::Paramify(parameterObject["options"]["path"].asString()));
else
cmd.Format("exportlibrary(video, true, %s, %s, %s)",
parameterObject["options"]["images"].asBoolean() ? "true" : "false",
Please sign in to comment.
Something went wrong with that request. Please try again.