mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-81313 (restore space escaping in BrowserUtil)
This commit is contained in:
@@ -171,11 +171,11 @@ public class BrowserUtil {
|
||||
|
||||
try {
|
||||
final GeneralCommandLine commandLine = new GeneralCommandLine(command);
|
||||
commandLine.addParameter(curl.toString());
|
||||
commandLine.addParameter(escapeUrl(curl.toString()));
|
||||
commandLine.createProcess();
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Browser launched with command line: " + commandLine.getCommandLineString());
|
||||
LOG.debug("Browser launched with command line: " + commandLine);
|
||||
}
|
||||
}
|
||||
catch (final ExecutionException e) {
|
||||
@@ -185,12 +185,8 @@ public class BrowserUtil {
|
||||
|
||||
@NotNull
|
||||
public static String escapeUrl(@NotNull @NonNls String url) {
|
||||
if (SystemInfo.isWindows) {
|
||||
return (url.indexOf(' ') > 0 || url.indexOf('&') > -1) ? "\"" + url + "\"" : url;
|
||||
}
|
||||
else {
|
||||
return url.replaceAll(" ", "%20");
|
||||
}
|
||||
return SystemInfo.isWindows ? url.replaceAll(" ", "%20")
|
||||
: url;
|
||||
}
|
||||
|
||||
private static boolean launchBrowserUsingDesktopApi(final String sUrl) {
|
||||
@@ -226,6 +222,7 @@ public class BrowserUtil {
|
||||
|
||||
public static String[] getOpenBrowserCommand(final @NonNls @NotNull String browserPath) {
|
||||
final String[] command;
|
||||
|
||||
if (SystemInfo.isMac) {
|
||||
if (new File(browserPath).isFile()) {
|
||||
// versions before 10.6 don't allow to pass command line arguments to browser via 'open' command
|
||||
@@ -247,6 +244,7 @@ public class BrowserUtil {
|
||||
else {
|
||||
command = new String[]{browserPath};
|
||||
}
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user