mirror of
https://github.com/gorhill/uBlock.git
synced 2025-01-31 12:11:36 +01:00
Better processing of Expires
directive in filter list
In case of invalid `Expires` value -- i.e. `NaN` -- do not use `1` as default value, just let uBO pick the value according to the global default (which is `5` as of commit time).
This commit is contained in:
parent
dc64cfbd97
commit
18a5f41a04
@ -760,12 +760,15 @@ self.addEventListener('hiddenSettingsChanged', ( ) => {
|
||||
// Extract update frequency information
|
||||
const matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires[\t ]*:[\t ]*(\d+)[\t ]*(h)?/i);
|
||||
if ( matches !== null ) {
|
||||
let v = Math.max(parseInt(matches[1], 10), 1);
|
||||
if ( matches[2] !== undefined ) {
|
||||
v = Math.ceil(v / 24);
|
||||
}
|
||||
if ( v !== listEntry.updateAfter ) {
|
||||
this.assets.registerAssetSource(assetKey, { updateAfter: v });
|
||||
let v = parseInt(matches[1], 10);
|
||||
if ( isNaN(v) === false ) {
|
||||
if ( matches[2] !== undefined ) {
|
||||
v = Math.ceil(v / 24);
|
||||
}
|
||||
v = Math.max(v, 1);
|
||||
if ( v !== listEntry.updateAfter ) {
|
||||
this.assets.registerAssetSource(assetKey, { updateAfter: v });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user