This repository was archived by the owner on Dec 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -129,19 +129,21 @@ require('./migrate-psql-db.js')(function (err) {
129129 }
130130 // Loop over each props
131131 Object . values ( args . q ) . forEach ( ( value , key ) => {
132- const insecureProp = [ 'nin$' , 'in$' ] ;
133- const detected = Object . keys ( value ) . filter ( ( val ) => insecureProp . indexOf ( val ) > - 1 ) ;
134- if ( detected . length > 0 ) {
135- // Loop over each detected insecureProp being used (nin or in)
136- detected . forEach ( ( col , key ) => {
137- const ids = value [ col ] ;
138- // Loop over each value of the array of the dangerous field
139- ids . forEach ( ( id ) => {
140- if ( ! / ^ [ a - z A - Z 0 - 9 - ] + $ / g. test ( id ) ) {
141- throw new Error ( `Unexpected characters in ${ col } ` ) ;
142- }
132+ if ( _ . isObject ( value ) ) {
133+ const insecureProp = [ 'nin$' , 'in$' ] ;
134+ const detected = Object . keys ( value ) . filter ( ( val ) => insecureProp . indexOf ( val ) > - 1 ) ;
135+ if ( detected . length > 0 ) {
136+ // Loop over each detected insecureProp being used (nin or in)
137+ detected . forEach ( ( col , key ) => {
138+ const ids = value [ col ] ;
139+ // Loop over each value of the array of the dangerous field
140+ ids . forEach ( ( id ) => {
141+ if ( ! / ^ [ a - z A - Z 0 - 9 - ] + $ / g. test ( id ) ) {
142+ throw new Error ( `Unexpected characters in ${ col } ` ) ;
143+ }
144+ } ) ;
143145 } ) ;
144- } ) ;
146+ }
145147 }
146148 } ) ;
147149 this . prior ( args , cb ) ;
You can’t perform that action at this time.
0 commit comments