Skip to content

Commit e619483

Browse files
authored
Reject old format indexes (forcing refetch) (#1596)
1 parent e7cfbe9 commit e619483

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

js/search.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ const initPHPSearch = async (language) => {
2828

2929
const expireDate = cachedDate + CACHE_DAYS * MILLISECONDS_PER_DAY;
3030

31+
// Reject old format indexes
32+
if (
33+
(typeof data[0] !== 'object')
34+
|| Array.isArray(data[0])
35+
) {
36+
return null;
37+
}
3138
if (Date.now() > expireDate) {
3239
return null;
3340
}

0 commit comments

Comments
 (0)