File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -336,17 +336,11 @@ exports.Server = function Server(bsClient, workers) {
336336
337337 if ( query && Array . isArray ( query . arguments ) ) {
338338 var context = { input : query . arguments , format : util . format , output : '' } ;
339- var tryEvalOrString = function ( arg ) {
340- try {
341- return eval ( 'o = ' + arg ) ;
342- } catch ( e ) {
343- return arg ;
344- }
345- } ;
339+ var tryEvalOrString = 'function (arg) { try { return eval(\'o = \' + arg); } catch (e) { return arg; } }' ;
346340
347341 try {
348342 // eval each element of query.arguments safely in an isolated context
349- vm . runInNewContext ( 'output = format.apply(null, input.map(' + tryEvalOrString . toString ( ) + '));' , context ) ;
343+ vm . runInNewContext ( 'output = format.apply(null, input.map(' + tryEvalOrString + '));' , context ) ;
350344 logger . info ( '[' + request . headers [ 'x-browser-string' ] + '] ' + context . output ) ;
351345 logged = true ;
352346 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments