@@ -63,23 +63,32 @@ describe('notify-send', function() {
6363 notifier . notify ( { message : 'some\n "me\'ss`age`"' } ) ;
6464 } ) ;
6565
66- it ( 'should send additional parameters as --"keyname"' , function ( done ) {
67- var expected = [ '"title"' , '"body"' , '--icon' , '"icon-string"' ] ;
66+ it ( 'should escape array items as normal items' , function ( done ) {
67+ var expected = [
68+ '"Hacked"' ,
69+ '"\\`touch HACKED\\`"' ,
70+ '--category' ,
71+ '"foo\\`touch exploit\\`"'
72+ ] ;
6873
6974 expectArgsListToBe ( expected , done ) ;
7075 var notifier = new Notify ( { suppressOsdCheck : true } ) ;
71- notifier . notify ( { title : 'title' , message : 'body' , icon : 'icon-string' } ) ;
76+ var options = JSON . parse (
77+ `{
78+ "title": "Hacked",
79+ "message":["\`touch HACKED\`"],
80+ "category": ["foo\`touch exploit\`"]
81+ }`
82+ ) ;
83+ notifier . notify ( options ) ;
7284 } ) ;
7385
74- it ( 'should only include strings as arguments ' , function ( done ) {
75- var expected = [ '"HACKED "' ] ;
86+ it ( 'should send additional parameters as --"keyname" ' , function ( done ) {
87+ var expected = [ '"title"' , '"body"' , '--icon' , '"icon-string "'] ;
7688
7789 expectArgsListToBe ( expected , done ) ;
7890 var notifier = new Notify ( { suppressOsdCheck : true } ) ;
79- var options = JSON . parse (
80- '{"title":"HACKED", "message":["`touch HACKED`"]}'
81- ) ;
82- notifier . notify ( options ) ;
91+ notifier . notify ( { title : 'title' , message : 'body' , icon : 'icon-string' } ) ;
8392 } ) ;
8493
8594 it ( 'should remove extra options that are not supported by notify-send' , function ( done ) {
0 commit comments