This repository was archived by the owner on Dec 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,19 +137,21 @@ require('./migrate-psql-db.js')(function (err) {
137137 }
138138 // Loop over each props
139139 Object . values ( args . q ) . forEach ( ( value , key ) => {
140- const insecureProp = [ 'nin$' , 'in$' ] ;
141- const detected = Object . keys ( value ) . filter ( ( val ) => insecureProp . indexOf ( val ) > - 1 ) ;
142- if ( detected . length > 0 ) {
143- // Loop over each detected insecureProp being used (nin or in)
144- detected . forEach ( ( col , key ) => {
145- const ids = value [ col ] ;
146- // Loop over each value of the array of the dangerous field
147- ids . forEach ( ( id ) => {
148- if ( ! / ^ [ a - z A - Z 0 - 9 - ] + $ / g. test ( id ) ) {
149- throw new Error ( `Unexpected characters in ${ col } ` ) ;
150- }
140+ if ( _ . isObject ( value ) ) {
141+ const insecureProp = [ 'nin$' , 'in$' ] ;
142+ const detected = Object . keys ( value ) . filter ( ( val ) => insecureProp . indexOf ( val ) > - 1 ) ;
143+ if ( detected . length > 0 ) {
144+ // Loop over each detected insecureProp being used (nin or in)
145+ detected . forEach ( ( col , key ) => {
146+ const ids = value [ col ] ;
147+ // Loop over each value of the array of the dangerous field
148+ ids . forEach ( ( id ) => {
149+ if ( ! / ^ [ a - z A - Z 0 - 9 - ] + $ / g. test ( id ) ) {
150+ throw new Error ( `Unexpected characters in ${ col } ` ) ;
151+ }
152+ } ) ;
151153 } ) ;
152- } ) ;
154+ }
153155 }
154156 } ) ;
155157 this . prior ( args , cb ) ;
You can’t perform that action at this time.
0 commit comments