Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8544

Regex option "ii" is accepted by JSON to BSON parser

    • Fully Compatible
    • ALL
    • Hide

      add the following test to jsontests.cpp

      class RegexInvalidOption7 : public Bad {
      virtual string json() const {
      return "{ \"a\" :

      { \"$regex\" : \"test\", \"$options\" : \"ii\" }

      }";
      }
      };

      and the output is

      JsonTests::FromJsonTests::RegexInvalidOption7 Expected expression fromjson( json() ) to throw MsgAssertionException but it threw nothing. @src/mongo/dbtests/jsontests.cpp:447

      Show
      add the following test to jsontests.cpp class RegexInvalidOption7 : public Bad { virtual string json() const { return "{ \"a\" : { \"$regex\" : \"test\", \"$options\" : \"ii\" } }"; } }; and the output is JsonTests::FromJsonTests::RegexInvalidOption7 Expected expression fromjson( json() ) to throw MsgAssertionException but it threw nothing. @src/mongo/dbtests/jsontests.cpp:447
    • Dev Tools 2019-06-03, Dev Tools 2019-06-17

          Assignee:
          nathan.brown@mongodb.com Nathan Brown (Inactive)
          Reporter:
          andrew.emil@10gen.com Andrew Emil (Inactive)
          Votes:
          0 Vote for this issue
          Watchers:
          5 Start watching this issue

            Created:
            Updated:
            Resolved: