Skip to content

Commit

Permalink
fix: ShowItemUsingFileManager should escape path in Linux
Browse files Browse the repository at this point in the history
Co-authored-by: hsfzxjy <hsfzxjy@gmail.com>
  • Loading branch information
trop[bot] and hsfzxjy committed Nov 20, 2023
1 parent ead3de1 commit 1ee04e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions shell/common/platform_util_linux.cc
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 1ee04e4

Please sign in to comment.