1
0
Fork 0

fix sanitation of externals

This commit is contained in:
Jan Steemann 2016-10-26 17:02:23 +02:00
parent 54f0e903df
commit b71317bbbc
1 changed files with 5 additions and 4 deletions

View File

@ -946,7 +946,8 @@ uint64_t VelocyPackHelper::hashByAttributes(
void VelocyPackHelper::SanitizeExternals(VPackSlice const input,
VPackBuilder& output) {
if (input.isExternal()) {
output.add(input.resolveExternal());
// recursively resolve externals
SanitizeExternals(input.resolveExternal(), output);
} else if (input.isObject()) {
output.openObject();
for (auto const& it : VPackObjectIterator(input)) {
@ -970,13 +971,13 @@ bool VelocyPackHelper::hasExternals(VPackSlice input) {
return true;
} else if (input.isObject()) {
for (auto const& it : VPackObjectIterator(input)) {
if (hasExternals(it.value) == true) {
if (hasExternals(it.value)) {
return true;
};
}
}
} else if (input.isArray()) {
for (auto const& it : VPackArrayIterator(input)) {
if (hasExternals(it) == true) {
if (hasExternals(it)) {
return true;
}
}