[web-php] master: Reject old format indexes (forcing refetch) (#1596)
| From: | AllenJB via GitHub | Date: | Thu, 06 Nov 2025 02:48:36 +0000 |
| Subject: | [web-php] master: Reject old format indexes (forcing refetch) (#1596) | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-33304@lists.php.net to get a copy of this message | ||
Author: AllenJB (AllenJB)
Committer: GitHub (web-flow)
Pusher: sy-records
Date: 2025-11-06T10:48:34+08:00
Commit: https://github.com/php/web-php/commit/e6194839e42347054ea396c5f215aa7ee01b9206
Raw diff: https://github.com/php/web-php/commit/e6194839e42347054ea396c5f215aa7ee01b9206.diff
Reject old format indexes (forcing refetch) (#1596)
Changed paths:
M js/search.js
Diff:
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;
}