diff --git a/js/search.js b/js/search.js index 807360ca99..6ef5008afe 100644 --- a/js/search.js +++ b/js/search.js @@ -28,6 +28,13 @@ const initPHPSearch = async (language) => { const expireDate = cachedDate + CACHE_DAYS * MILLISECONDS_PER_DAY; + // Reject old format indexes + if ( + (typeof data[0] !== 'object') + || Array.isArray(data[0]) + ) { + return null; + } if (Date.now() > expireDate) { return null; }