Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion modules/validations/invalid_format.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,26 @@ export function validationFormatting() {
entityIds: [entity.id]
};

const urlValidationKeys = new Set([
'website',
'url',
'contact:website',
'contact:url',
'source:website',
'source:url',
'image',
'wikimedia_commons',
'brand:website',
'operator:website',
'network:website',
'website:en',
'website:fr',
'website:menu',
'post_office:website',
]);

Object.entries(entity.tags).map(function([key, tag]) {
if (!/\b(website|url)\b|^image$/i.test(key)) return null;
if (!urlValidationKeys.has(key)) return null;
if (!tag) return null;
const value = tag.trim();
if (!value) return null;
Expand Down