From 33e9b2ab7e59952a5a369013036a551016f8597b Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 20 Mar 2017 23:21:09 -0400 Subject: [PATCH] Replace opening hours whitelist with regular expression --- modules/ui/entity_editor.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index 5168dbd8a..f9abfd139 100644 --- a/modules/ui/entity_editor.js +++ b/modules/ui/entity_editor.js @@ -174,9 +174,7 @@ export function uiEntityEditor(context) { function cleanVal(k, v) { function keepSpaces(k) { - var whitelist = ['opening_hours', 'service_times', 'collection_times', - 'operating_times', 'smoking_hours', 'happy_hours']; - return _.some(whitelist, function(s) { return k.indexOf(s) !== -1; }); + return k.match(/_hours|_times/) !== null; } var blacklist = ['description', 'note', 'fixme']; @@ -188,7 +186,6 @@ export function uiEntityEditor(context) { // The code below is not intended to validate websites and emails. // It is only intended to prevent obvious copy-paste errors. (#2323) - // clean website- and email-like tags if (k.indexOf('website') !== -1 || k.indexOf('email') !== -1 ||