Page MenuHomePhabricator

Add a validator to cached {{#get_external_data:}} functions
Open, Needs TriagePublicFeature

Description

Add a parser function parameter and a corresponding data source setting to cached accessor functions ({{#get_wb_data:}}. etc.)--a regular expression or a callable, against which the fetched text will be checked before caching and parsing.

If the validation fails, do not cache the retrieved text and produce an error message.

Motivation: an external web site can go defunct but still return HTTP response code 200, i.e., if the domain expired and was taken by cybersquatters. In this case, the old stale cache should be preserved, not replaced with the new technically valid but meaningless text.