forked from 0x2620/pandora
avoid call to getDocument with random string as item
This commit is contained in:
parent
c87ea9a577
commit
110c0b252a
1 changed files with 9 additions and 0 deletions
|
|
@ -1654,6 +1654,11 @@ pandora.getItem = function(state, str, callback) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (state.type == 'documents') {
|
} else if (state.type == 'documents') {
|
||||||
|
if (!pandora.isBase26(str)) {
|
||||||
|
state.item = '';
|
||||||
|
callback();
|
||||||
|
return
|
||||||
|
}
|
||||||
pandora.api.getDocument({
|
pandora.api.getDocument({
|
||||||
id: str,
|
id: str,
|
||||||
// send keys so that subsequent request when parsing
|
// send keys so that subsequent request when parsing
|
||||||
|
|
@ -1702,6 +1707,10 @@ pandora.getItem = function(state, str, callback) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pandora.isBase26 = function(value) {
|
||||||
|
return /^[A-Z]+$/.test(value)
|
||||||
|
};
|
||||||
|
|
||||||
pandora.getItemFind = function(find) {
|
pandora.getItemFind = function(find) {
|
||||||
var itemFind = '';
|
var itemFind = '';
|
||||||
Ox.forEach(find.conditions, function(condition) {
|
Ox.forEach(find.conditions, function(condition) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue