Ticket #21853: 0001-improve-validation-of-interval-tag.patch

File 0001-improve-validation-of-interval-tag.patch, 1.6 KB (added by nlehuby, 4 years ago)

new patch

  • resources/data/validator/numeric.mapcss

    From d45966e1fd86057e82e352a4faac199f03824bea Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?No=C3=A9mie=20Lehuby?= <noemie@junglebus.io>
    Date: Fri, 18 Feb 2022 15:17:02 +0100
    Subject: [PATCH] improve validation of interval tag
    
    ---
     resources/data/validator/numeric.mapcss | 8 +++++---
     1 file changed, 5 insertions(+), 3 deletions(-)
    
    diff --git a/resources/data/validator/numeric.mapcss b/resources/data/validator/numeric.mapcss
    index 821df43cd..07f60f203 100644
    a b node[fire_hydrant:pressure="#"] {  
    530530  throwError: tr("unusual value of {0}", "{0.key}");
    531531}
    532532
    533 *[interval][interval !~ /^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] {
     533*[interval][interval !~ /^([0-9][0-9]?[0-9]?|[0-9]+[0-9]:[0-5][0-9](:[0-5][0-9])?)$/] {
    534534  throwWarning: tr("unusual value of {0}", "{0.key}");
    535535  assertNoMatch: "way interval=5";
    536536  assertNoMatch: "way interval=20";
    537537  assertNoMatch: "way interval=00:05";
    538538  assertNoMatch: "way interval=00:05:00";
    539539  assertNoMatch: "way interval=03:00:00";
    540   assertMatch: "way interval=123";
     540  assertNoMatch: "relation interval=168:00:00";
     541  assertNoMatch: "relation interval=120";
    541542  assertMatch: "way interval=0:5:0";
    542543  assertMatch: "way interval=00:65:00";
     544  assertMatch: "way interval=00:15:90";
    543545}
    544546
    545547/* #15107 */
    node[fire_hydrant:pressure="#"] {  
    669671  assertMatch: "node name=12";
    670672  assertMatch: "node name=3.5";
    671673  assertNoMatch: "node name=\"1. Chemnitzer Billardclub 1952 e.V.\"";
    672 }
    673  No newline at end of file
     674}