fix: ShowItemUsingFileManager should escape path in Linux (#40562)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: hsfzxjy <hsfzxjy@gmail.com>
This commit is contained in:
trop[bot]
2023-11-21 10:23:03 +09:00
committed by GitHub
parent 33b39fb63d
commit a3986f84db

View File

@@ -21,6 +21,7 @@
#include "base/posix/eintr_wrapper.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h"
#include "components/dbus/thread_linux/dbus_thread_linux.h"
@@ -216,8 +217,9 @@ class ShowItemHelper {
dbus::MessageWriter writer(&show_items_call);
writer.AppendArrayOfStrings(
{"file://" + full_path.value()}); // List of file(s) to highlight.
writer.AppendString({}); // startup-id
{"file://" + base::EscapePath(
full_path.value())}); // List of file(s) to highlight.
writer.AppendString({}); // startup-id
ShowItemUsingBusCall(&show_items_call, full_path);
}