I would like to see the rest of that too, but it could very well be a string literal with question marks, followed by an array of parameters in the second arg as many node SQL libraries do.
It looks like "rows" is a global variable, so every single db call in the entire app uses one variable to store the results, and they just overwrite each other every time
It's a search in what looks like VS Code, using regex. ^ is the beginning of the line \s is whitespace \[ is [ \w+ matches a word (although OP has it in even more brackets here] and so on.
It's a search for assigning values to variables inside brackets.
Tbf, when Javascript was designed it was largely contained to a single webpage where the scope and context was completely different than how it might be used today.
This is the default behavior just for compatability, just like ==. Program throws an error instead of implicitly creating a global if you use "use strict"; or in ES6 modules (they are always strict).
70
u/[deleted] Apr 15 '22
Obviously you're working with a 0.1xer
40
u/irkine Apr 15 '22
I am a little more worried about the text in those “execute()s”. I smell SQL Injection. Can’t say for sure without more context, buuuut…
13
u/VNIZ Apr 15 '22
can someone explain what the hell im looking at?
2
u/[deleted] Apr 16 '22
Bro you know regex? You’re too good for this job lol
67
u/TheUnlocked Apr 15 '22
From this screenshot it's not clear that that's not just destructuring assignment to a local variable.
8
u/andlrc Apr 15 '22 edited Apr 15 '22
You dont need those character classes, actually in some regex flavors [\w] would mean either \ or w, or just w. Same goes for [\s]
1
u/[deleted] Apr 15 '22
Dirty code...
1
u/bruhred Apr 16 '22
They don't if you use
"use strict";or in ES6 modules (they are always strict). Always (if possible) use one of these two options.1
u/gngmntl Apr 16 '22
Send web app cus I see a vulnerability...
0
u/PhatOofxD Apr 16 '22
Couldn't that just be destructuring?
0
u/[deleted] Apr 15 '22
[deleted] — view deleted comment