mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 09:12:28 +02:00
limit allowed types for JSON Query
limited allowed types for JSON::Query to Object, Array, Object::Ptr, Array::Ptr and empty
This commit is contained in:
@@ -50,6 +50,12 @@ namespace JSON {
|
||||
|
||||
Query::Query(const Var& source): _source(source)
|
||||
{
|
||||
if (!source.isEmpty() &&
|
||||
source.type() != typeid(Object) &&
|
||||
source.type() != typeid(Object::Ptr) &&
|
||||
source.type() != typeid(Array) &&
|
||||
source.type() != typeid(Array::Ptr))
|
||||
throw InvalidArgumentException("Only JSON Object, Array or pointers thereof allowed.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user