Index: chrome/common/chrome_plugin_util.cc |
=================================================================== |
--- chrome/common/chrome_plugin_util.cc (revision 27632) |
+++ chrome/common/chrome_plugin_util.cc (working copy) |
@@ -140,8 +140,13 @@ |
// Use '--app=url' instead of just 'url' to launch the browser with minimal |
// chrome. |
// Note: Do not change this flag! Old Gears shortcuts will break if you do! |
- std::wstring url_w = UTF8ToWide(url); |
- arguments_w += std::wstring(L"--") + switches::kApp + L'=' + url_w; |
+ std::string url_string(url); |
+ ReplaceSubstringsAfterOffset(&url_string, 0, "\"", "\\\""); |
+ ReplaceSubstringsAfterOffset(&url_string, 0, "%", "%%"); |
+ ReplaceSubstringsAfterOffset(&url_string, 0, ";", ""); |
+ ReplaceSubstringsAfterOffset(&url_string, 0, "$", ""); |
+ std::wstring url_w = UTF8ToWide(url_string); |
+ arguments_w += std::wstring(L"--") + switches::kApp + L"=\"" + url_w + L"\""; |
*arguments = WideToUTF8(arguments_w); |