mirror of
https://github.com/rstudio/shiny.git
synced 2026-04-07 03:00:20 -04:00
Escape a few more characters for conditionalPanel expressions
This commit is contained in:
@@ -179,7 +179,9 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
||||
// "with" on the argument value, and return the result.
|
||||
function scopeExprToFunc(expr) {
|
||||
/*jshint evil: true */
|
||||
var expr_escaped = expr.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0').replace(/\n/g, '\\n');
|
||||
var expr_escaped = expr.replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0').replace(/\n/g, '\\n').replace(/\r/g, '\\r')
|
||||
// \b has a special meaning; need [\b] to match backspace char.
|
||||
.replace(/[\b]/g, '\\b');
|
||||
|
||||
try {
|
||||
var func = new Function('with (this) {\n try {\n return (' + expr + ');\n } catch (e) {\n console.error(\'Error evaluating expression: ' + expr_escaped + '\');\n throw e;\n }\n }');
|
||||
|
||||
File diff suppressed because one or more lines are too long
4
inst/www/shared/shiny.min.js
vendored
4
inst/www/shared/shiny.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -164,7 +164,10 @@ function scopeExprToFunc(expr) {
|
||||
var expr_escaped = expr
|
||||
.replace(/[\\"']/g, '\\$&')
|
||||
.replace(/\u0000/g, '\\0')
|
||||
.replace(/\n/g, '\\n');
|
||||
.replace(/\n/g, '\\n')
|
||||
.replace(/\r/g, '\\r')
|
||||
// \b has a special meaning; need [\b] to match backspace char.
|
||||
.replace(/[\b]/g, '\\b');
|
||||
|
||||
try {
|
||||
var func = new Function(
|
||||
|
||||
Reference in New Issue
Block a user