Skip to content

Commit b279d73

Browse files
committed
fix string comparison
1 parent 765cfd0 commit b279d73

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Controllers/DatabaseController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1763,7 +1763,7 @@ class DatabaseController {
17631763
if (this.options && this.options.requestKeywordDenylist) {
17641764
// Scan request data for denied keywords
17651765
for (const keyword of this.options.requestKeywordDenylist) {
1766-
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(a).test(b)) || a === b;
1766+
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(b).test(a)) || a === b;
17671767
if (isMatch(firstKey, keyword.key)) {
17681768
throw new Parse.Error(
17691769
Parse.Error.INVALID_KEY_NAME,

src/Utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ class Utils {
341341
* @returns {Boolean} True if a match was found, false otherwise.
342342
*/
343343
static objectContainsKeyValue(obj, key, value) {
344-
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(a).test(b)) || a === b;
344+
const isMatch = (a, b) => (typeof a === 'string' && new RegExp(b).test(a)) || a === b;
345345
const isKeyMatch = k => isMatch(key, k);
346346
const isValueMatch = v => isMatch(value, v);
347347
for (const [k, v] of Object.entries(obj)) {

0 commit comments

Comments
 (0)