mirror of https://gitee.com/bigwinds/arangodb
fix sanitation of externals
This commit is contained in:
parent
54f0e903df
commit
b71317bbbc
|
@ -946,7 +946,8 @@ uint64_t VelocyPackHelper::hashByAttributes(
|
||||||
void VelocyPackHelper::SanitizeExternals(VPackSlice const input,
|
void VelocyPackHelper::SanitizeExternals(VPackSlice const input,
|
||||||
VPackBuilder& output) {
|
VPackBuilder& output) {
|
||||||
if (input.isExternal()) {
|
if (input.isExternal()) {
|
||||||
output.add(input.resolveExternal());
|
// recursively resolve externals
|
||||||
|
SanitizeExternals(input.resolveExternal(), output);
|
||||||
} else if (input.isObject()) {
|
} else if (input.isObject()) {
|
||||||
output.openObject();
|
output.openObject();
|
||||||
for (auto const& it : VPackObjectIterator(input)) {
|
for (auto const& it : VPackObjectIterator(input)) {
|
||||||
|
@ -970,13 +971,13 @@ bool VelocyPackHelper::hasExternals(VPackSlice input) {
|
||||||
return true;
|
return true;
|
||||||
} else if (input.isObject()) {
|
} else if (input.isObject()) {
|
||||||
for (auto const& it : VPackObjectIterator(input)) {
|
for (auto const& it : VPackObjectIterator(input)) {
|
||||||
if (hasExternals(it.value) == true) {
|
if (hasExternals(it.value)) {
|
||||||
return true;
|
return true;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
} else if (input.isArray()) {
|
} else if (input.isArray()) {
|
||||||
for (auto const& it : VPackArrayIterator(input)) {
|
for (auto const& it : VPackArrayIterator(input)) {
|
||||||
if (hasExternals(it) == true) {
|
if (hasExternals(it)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue