From b723b53fc0b573bd228d7e064524ab9f03099f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sautter?= Date: Tue, 11 Oct 2022 20:49:25 +0200 Subject: [PATCH] removed the broken escape The quote marks were replaced by identical quote marks to escape them. This is an unnecessary operation, as the resulting string will be identical to the original string. --- java/src/org/openqa/selenium/remote/RemoteWebDriver.java | 6 ------ .../selenium/remote/codec/w3c/W3CHttpCommandCodec.java | 3 --- 2 files changed, 9 deletions(-) diff --git a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java index 0148ff5da35b0..517bd3554089d 100644 --- a/java/src/org/openqa/selenium/remote/RemoteWebDriver.java +++ b/java/src/org/openqa/selenium/remote/RemoteWebDriver.java @@ -472,9 +472,6 @@ public Object executeScript(String script, Object... args) { "You must be using an underlying instance of WebDriver that supports executing javascript"); } - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList()); @@ -488,9 +485,6 @@ public Object executeAsyncScript(String script, Object... args) { "WebDriver that supports executing javascript"); } - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList()); diff --git a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java index 7f60dba947ff6..d1e6e9f66abb3 100644 --- a/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java +++ b/java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java @@ -351,9 +351,6 @@ private List stringToUtf8Array(String toConvert) { } private Map toScript(String script, Object... args) { - // Escape the quote marks - script = script.replaceAll("\"", "\\\""); - List convertedArgs = Stream.of(args).map(new WebElementToJsonConverter()).collect( Collectors.toList());