xzwebx-httpfilter 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HttpFilter.js +45 -11
- package/package.json +1 -1
package/HttpFilter.js
CHANGED
|
@@ -205,25 +205,48 @@ function IsStringOk(fCfgItem, paramValue) {
|
|
|
205
205
|
}
|
|
206
206
|
} else if (rule.checkType == 'ENU') {
|
|
207
207
|
if (rule.isCaseSensitive == 1) {
|
|
208
|
-
if (rule.exprVal && rule.exprVal.length
|
|
209
|
-
if (rule.
|
|
210
|
-
|
|
208
|
+
if (rule.exprVal && rule.exprVal.length) {
|
|
209
|
+
if (rule.isMatched === 1) {
|
|
210
|
+
if (!rule.exprVal.includes(paramValue)) {
|
|
211
|
+
if (rule.ruleDesc) {
|
|
212
|
+
return rule.ruleDesc
|
|
213
|
+
}
|
|
214
|
+
return ['WRONG_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
215
|
+
}
|
|
216
|
+
} else {
|
|
217
|
+
if (rule.exprVal.includes(paramValue)) {
|
|
218
|
+
if (rule.ruleDesc) {
|
|
219
|
+
return rule.ruleDesc
|
|
220
|
+
}
|
|
221
|
+
return ['EXCLUSION_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
222
|
+
}
|
|
211
223
|
}
|
|
212
|
-
return ['WRONG_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
213
224
|
}
|
|
214
225
|
} else {
|
|
215
226
|
let isPass = false
|
|
216
227
|
for (let k in rule.exprVal) {
|
|
217
|
-
if (rule.
|
|
228
|
+
if (rule.isMatched === 1) {
|
|
229
|
+
if (rule.exprVal[k].toUpperCase() === paramValue.toUpperCase()) {
|
|
230
|
+
isPass = true
|
|
231
|
+
break
|
|
232
|
+
}
|
|
233
|
+
} else {
|
|
218
234
|
isPass = true
|
|
219
|
-
|
|
235
|
+
if (rule.exprVal[k].toUpperCase() == paramValue.toUpperCase()) {
|
|
236
|
+
isPass = false
|
|
237
|
+
break
|
|
238
|
+
}
|
|
220
239
|
}
|
|
221
240
|
}
|
|
222
241
|
if (!isPass) {
|
|
223
242
|
if (rule.ruleDesc) {
|
|
224
243
|
return rule.ruleDesc
|
|
225
244
|
}
|
|
226
|
-
|
|
245
|
+
if (rule.isMatched === 1) {
|
|
246
|
+
return ['WRONG_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
247
|
+
} else {
|
|
248
|
+
return ['EXCLUSION_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
249
|
+
}
|
|
227
250
|
}
|
|
228
251
|
}
|
|
229
252
|
} else if (rule.checkType == 'REGEX') {
|
|
@@ -288,11 +311,22 @@ function IsIntOk(fCfgItem, paramValue) {
|
|
|
288
311
|
return ['WRONG_INT_RANGE', fCfgItem.fieldUrl, JSON.stringify(rule.exprVal)]
|
|
289
312
|
}
|
|
290
313
|
} else if (rule.checkType == 'ENU') {
|
|
291
|
-
if (rule.exprVal && rule.exprVal.length
|
|
292
|
-
if (rule.
|
|
293
|
-
|
|
314
|
+
if (rule.exprVal && rule.exprVal.length) {
|
|
315
|
+
if (rule.isMatched === 1) {
|
|
316
|
+
if (!rule.exprVal.includes(paramValue)) {
|
|
317
|
+
if (rule.ruleDesc) {
|
|
318
|
+
return rule.ruleDesc
|
|
319
|
+
}
|
|
320
|
+
return ['WRONG_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
321
|
+
}
|
|
322
|
+
} else {
|
|
323
|
+
if (rule.exprVal.includes(paramValue)) {
|
|
324
|
+
if (rule.ruleDesc) {
|
|
325
|
+
return rule.ruleDesc
|
|
326
|
+
}
|
|
327
|
+
return ['EXCLUSION_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
328
|
+
}
|
|
294
329
|
}
|
|
295
|
-
return ['WRONG_ENU_VALUE', fCfgItem.fieldUrl, rule.exprVal]
|
|
296
330
|
}
|
|
297
331
|
} else if (rule.checkType == 'REGEX') {
|
|
298
332
|
let isPass = false
|