diff --git a/packages/crud-typeorm/src/typeorm-crud.service.ts b/packages/crud-typeorm/src/typeorm-crud.service.ts index 32a9d9f1..53187f5e 100644 --- a/packages/crud-typeorm/src/typeorm-crud.service.ts +++ b/packages/crud-typeorm/src/typeorm-crud.service.ts @@ -1043,7 +1043,7 @@ export class TypeOrmCrudService extends CrudService { return { str, params }; } - private checkFilterIsArray(cond: QueryFilter, withLength?: boolean) { + protected checkFilterIsArray(cond: QueryFilter, withLength?: boolean) { /* istanbul ignore if */ if ( !Array.isArray(cond.value) || @@ -1054,12 +1054,12 @@ export class TypeOrmCrudService extends CrudService { } } - private checkSqlInjection(field: string): string { + protected checkSqlInjection(field: string): string { /* istanbul ignore else */ if (this.sqlInjectionRegEx.length) { for (let i = 0; i < this.sqlInjectionRegEx.length; i++) { /* istanbul ignore else */ - if (this.sqlInjectionRegEx[0].test(field)) { + if (this.sqlInjectionRegEx[i].test(field)) { this.throwBadRequestException(`SQL injection detected: "${field}"`); } }