Bugfixes
This commit is contained in:
@@ -94,6 +94,23 @@ async function runQuery({
|
||||
.replace(/ {2,}/g, " ")
|
||||
.trim();
|
||||
|
||||
/**
|
||||
* Input Validation
|
||||
*
|
||||
* @description Input Validation
|
||||
*/
|
||||
if (
|
||||
readOnly &&
|
||||
(formattedQuery.match(
|
||||
/^alter|^delete|information_schema|databases|^create/i
|
||||
) ||
|
||||
!formattedQuery.match(/^select|^\( ?select/i))
|
||||
) {
|
||||
throw new Error("Wrong Input!");
|
||||
}
|
||||
|
||||
console.log("formattedQuery =>", formattedQuery);
|
||||
|
||||
if (local) {
|
||||
const rawResults = await LOCAL_DB_HANDLER(
|
||||
formattedQuery,
|
||||
|
||||
Reference in New Issue
Block a user