Ox.URL: don't treat 7-digit numbers as dates

This commit is contained in:
rlx 2013-03-06 10:00:41 +00:00
parent e21f184d96
commit 1115a33a5f

View file

@ -586,10 +586,11 @@ Ox.URL = function(options) {
: canBeLocation && length == 4 ? 'location' : canBeLocation && length == 4 ? 'location'
// leaves us with [-]D[.D][,[-]D[.D]] // leaves us with [-]D[.D][,[-]D[.D]]
: canBeDuration ? 'duration' : canBeDuration ? 'duration'
: canBeDate && !/\./.test(str) ? 'date' : canBeDate && !/\./.test(str) && !/^\d{7}$/.test(str) ? 'date'
: canBeLocation && length == 2 ? 'location' : canBeLocation && length == 2 ? 'location'
: canBeNumber && /^\d+$/.test(str) ? 'number' : canBeNumber && /^\d+$/.test(str) ? 'number'
: ''; : '';
// !/^\d{7}$/.test(str) avoids matching imdb ids
} }
function parseCondition(str) { function parseCondition(str) {