mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-06 09:37:12 +02:00
Catch cases of ! Expires:
field with no value
This commit is contained in:
parent
bda46d5cc7
commit
9ce958432d
@ -52,7 +52,7 @@ const stringIsNotEmpty = s => typeof s === 'string' && s !== '';
|
|||||||
|
|
||||||
const parseExpires = s => {
|
const parseExpires = s => {
|
||||||
const matches = s.match(/(\d+)\s*([dhm]?)/i);
|
const matches = s.match(/(\d+)\s*([dhm]?)/i);
|
||||||
if ( matches === null ) { return 0; }
|
if ( matches === null ) { return; }
|
||||||
let updateAfter = parseInt(matches[1], 10);
|
let updateAfter = parseInt(matches[1], 10);
|
||||||
if ( matches[2] === 'h' ) {
|
if ( matches[2] === 'h' ) {
|
||||||
updateAfter = Math.max(updateAfter, 4) / 24;
|
updateAfter = Math.max(updateAfter, 4) / 24;
|
||||||
|
Loading…
Reference in New Issue
Block a user