We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 977c310 commit a9ca629Copy full SHA for a9ca629
javascript/selenium-core/xpath/xpath.js
@@ -1236,7 +1236,10 @@ FunctionCallExpr.prototype.xpathfunctions = {
1236
var s2 = this.args[2].evaluate(ctx).stringValue();
1237
1238
for (var i = 0; i < s1.length; ++i) {
1239
- s0 = s0.replace(new RegExp(s1.charAt(i), 'g'), s2.charAt(i));
+ var c = s1.charAt(i);
1240
+ if ("^.|?+*(){}[]\\$".indexOf(c) != -1)
1241
+ c = "\\" + c; // escape special characters
1242
+ s0 = s0.replace(new RegExp(c, 'g'), s2.charAt(i));
1243
}
1244
return new StringValue(s0);
1245
},
0 commit comments